Skip to content

Commit

Permalink
feat: work on wildflowers
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeEchoCodes committed Dec 7, 2024
1 parent e97d9cf commit 69db538
Show file tree
Hide file tree
Showing 27 changed files with 293 additions and 9 deletions.
14 changes: 9 additions & 5 deletions src/client/java/dev/spiritstudios/hollow/HollowClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ public void onInitializeClient() {
ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlocks.GIANT_LILYPAD);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItems.GIANT_LILYPAD);

ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> {
return tintIndex != 0 ?
world != null && pos != null ? BiomeColors.getGrassColor(world, pos) : GrassColors.getDefaultColor() :
-1;
}, HollowBlocks.BLUE_WILDFLOWER, HollowBlocks.WHITE_WILDFLOWER, HollowBlocks.PURPLE_WILDFLOWER);
ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) ->
tintIndex != 0 ?
world != null && pos != null ? BiomeColors.getGrassColor(world, pos) : GrassColors.getDefaultColor() :
-1,
HollowBlocks.BLUE_WILDFLOWER,
HollowBlocks.WHITE_WILDFLOWER,
HollowBlocks.PURPLE_WILDFLOWER,
HollowBlocks.PINK_WILDFLOWER
);

ParticleFactoryRegistry.getInstance().register(HollowParticleTypes.FIREFLY_JAR, FireflyJarParticle.Factory::new);

Expand Down
160 changes: 160 additions & 0 deletions src/main/generated/assets/hollow/blockstates/pink_wildflower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"multipart": [
{
"apply": {
"model": "hollow:block/pink_wildflower_1"
},
"when": {
"facing": "north",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_1",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_1",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_1",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "1|2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_2"
},
"when": {
"facing": "north",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_2",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_2",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_2",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "2|3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_3"
},
"when": {
"facing": "north",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_3",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_3",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_3",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "3|4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_4"
},
"when": {
"facing": "north",
"flower_amount": "4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_4",
"y": 90
},
"when": {
"facing": "east",
"flower_amount": "4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_4",
"y": 180
},
"when": {
"facing": "south",
"flower_amount": "4"
}
},
{
"apply": {
"model": "hollow:block/pink_wildflower_4",
"y": 270
},
"when": {
"facing": "west",
"flower_amount": "4"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/flowerbed_1",
"textures": {
"flowerbed": "hollow:block/pink_wildflower",
"stem": "minecraft:block/pink_petals_stem"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/flowerbed_2",
"textures": {
"flowerbed": "hollow:block/pink_wildflower",
"stem": "minecraft:block/pink_petals_stem"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/flowerbed_3",
"textures": {
"flowerbed": "hollow:block/pink_wildflower",
"stem": "minecraft:block/pink_petals_stem"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/flowerbed_4",
"textures": {
"flowerbed": "hollow:block/pink_wildflower",
"stem": "minecraft:block/pink_petals_stem"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hollow:block/blue_wildflower"
"layer0": "hollow:item/blue_wildflower"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hollow:item/pink_wildflower"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hollow:block/purple_wildflower"
"layer0": "hollow:item/purple_wildflower"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hollow:block/white_wildflower"
"layer0": "hollow:item/white_wildflower"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"conditions": [
{
"block": "hollow:pink_wildflower",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "1"
}
}
],
"count": 1.0,
"function": "minecraft:set_count"
},
{
"add": false,
"conditions": [
{
"block": "hollow:pink_wildflower",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "2"
}
}
],
"count": 2.0,
"function": "minecraft:set_count"
},
{
"add": false,
"conditions": [
{
"block": "hollow:pink_wildflower",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "3"
}
}
],
"count": 3.0,
"function": "minecraft:set_count"
},
{
"add": false,
"conditions": [
{
"block": "hollow:pink_wildflower",
"condition": "minecraft:block_state_property",
"properties": {
"flower_amount": "4"
}
}
],
"count": 4.0,
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "hollow:pink_wildflower"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static void init() {

helper.addAfter(
Items.PINK_PETALS,
HollowBlocks.PINK_WILDFLOWER,
HollowBlocks.PURPLE_WILDFLOWER,
HollowBlocks.BLUE_WILDFLOWER,
HollowBlocks.WHITE_WILDFLOWER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void generate() {
this.addDrop(HollowBlocks.PURPLE_WILDFLOWER, this.flowerbedDrops(HollowBlocks.PURPLE_WILDFLOWER));
this.addDrop(HollowBlocks.WHITE_WILDFLOWER, this.flowerbedDrops(HollowBlocks.WHITE_WILDFLOWER));
this.addDrop(HollowBlocks.BLUE_WILDFLOWER, this.flowerbedDrops(HollowBlocks.BLUE_WILDFLOWER));
this.addDrop(HollowBlocks.PINK_WILDFLOWER, this.flowerbedDrops(HollowBlocks.PINK_WILDFLOWER));

this.addDrop(HollowBlocks.PAEONIA);
this.addPottedPlantDrops(HollowBlocks.POTTED_PAEONIA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void generateBlockStateModels(BlockStateModelGenerator generator) {
generator.registerItemModel(HollowBlocks.FIREFLY_JAR.asItem());
generator.registerStateWithModelReference(HollowBlocks.FIREFLY_JAR, HollowBlocks.JAR);

registerFlowerbed(generator, HollowBlocks.PINK_WILDFLOWER);
registerFlowerbed(generator, HollowBlocks.BLUE_WILDFLOWER);
registerFlowerbed(generator, HollowBlocks.WHITE_WILDFLOWER);
registerFlowerbed(generator, HollowBlocks.PURPLE_WILDFLOWER);
Expand Down Expand Up @@ -267,7 +268,7 @@ private static BlockStateSupplier createAxisRotatedBlockStateWithMossy(Block blo
);

private static void registerFlowerbed(BlockStateModelGenerator generator, Block flowerbed) {
generator.registerItemModel(flowerbed);
generator.registerItemModel(flowerbed.asItem());
Identifier one = FLOWERBED_1.upload(flowerbed, generator.modelCollector);
Identifier two = FLOWERBED_2.upload(flowerbed, generator.modelCollector);
Identifier three = FLOWERBED_3.upload(flowerbed, generator.modelCollector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ public final class HollowBlocks implements BlockRegistrar {
@NoBlockItem
public static final Block POTTED_ROOTED_ORCHID = Blocks.createFlowerPotBlock(ROOTED_ORCHID);

public static final Block PINK_WILDFLOWER = new FlowerbedBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.PINK)
.noCollision()
.sounds(BlockSoundGroup.PINK_PETALS)
.pistonBehavior(PistonBehavior.DESTROY));

public static final Block BLUE_WILDFLOWER = new FlowerbedBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLUE)
.noCollision()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"hollow:blue_wildflower": "cutout",
"hollow:white_wildflower": "cutout",
"hollow:purple_wildflower": "cutout",
"hollow:pink_wildflower": "cutout",
"hollow:paeonia": "cutout",
"hollow:lotus_lilypad": "cutout",
"hollow:giant_lilypad": "cutout",
Expand Down

0 comments on commit 69db538

Please sign in to comment.