Skip to content

Commit

Permalink
1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisuika committed Dec 11, 2024
1 parent d0e0589 commit 773e161
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 115 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs = -Xmx1G
loom.platform = fabric

minecraft_version = 1.21.3
minecraft_version = 1.21.4
parchment_version = 2024.11.10

mod_id = blossom
Expand All @@ -10,5 +10,5 @@ mod_version = 2.0.0
maven_group = dev.yurisuika.blossom
archives_base_name = blossom

fabric_version = 0.107.3+1.21.3
fabric_version = 0.110.5+1.21.4
loader_version = 0.16.9
30 changes: 0 additions & 30 deletions src/main/java/dev/yurisuika/blossom/Blossom.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import dev.yurisuika.blossom.util.config.Config;
import dev.yurisuika.blossom.world.entity.animal.BeeInterface;
import dev.yurisuika.blossom.world.level.block.BlossomBlocks;
import dev.yurisuika.blossom.world.level.block.FloweringLeavesBlock;
import dev.yurisuika.blossom.world.level.block.FruitingLeavesBlock;
import dev.yurisuika.blossom.world.level.item.BlossomItems;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.ModInitializer;
Expand All @@ -20,21 +18,13 @@
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.registry.CompostingChanceRegistry;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BiomeColors;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.core.component.DataComponents;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.animal.Bee;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.component.BlockItemStateProperties;
import net.minecraft.world.level.FoliageColor;

import java.util.Objects;

public class Blossom implements ModInitializer {

public static void registerCompostables() {
Expand Down Expand Up @@ -63,7 +53,6 @@ public static void registerGoals() {
});
}

@Override
public void onInitialize() {
Config.loadConfig();
Validate.checkBounds();
Expand Down Expand Up @@ -94,29 +83,10 @@ public static void registerBlockColors() {
ColorProviderRegistry.BLOCK.register((state, level, pos, tintIndex) -> level != null && pos != null ? BiomeColors.getAverageFoliageColor(level, pos) : FoliageColor.get(0.5F, 1.0F), BlossomBlocks.FLOWERING_OAK_LEAVES);
}

public static void registerItemColors() {
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : Minecraft.getInstance().getBlockColors().getColor(((BlockItem) stack.getItem()).getBlock().defaultBlockState(), null, null, tintIndex), BlossomBlocks.FRUITING_OAK_LEAVES);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : Minecraft.getInstance().getBlockColors().getColor(((BlockItem) stack.getItem()).getBlock().defaultBlockState(), null, null, tintIndex), BlossomBlocks.FLOWERING_OAK_LEAVES);
}

public static void registerItemProperties() {
ItemProperties.register(BlossomItems.FRUITING_OAK_LEAVES, ResourceLocation.tryParse("age"), (stack, world, entity, seed) -> {
Integer integer = stack.getOrDefault(DataComponents.BLOCK_STATE, BlockItemStateProperties.EMPTY).get(FruitingLeavesBlock.AGE);
return Objects.nonNull(integer) ? integer / 8.0F : 0.0F;
});
ItemProperties.register(BlossomItems.FLOWERING_OAK_LEAVES, ResourceLocation.tryParse("age"), (stack, world, entity, seed) -> {
Integer integer = stack.getOrDefault(DataComponents.BLOCK_STATE, BlockItemStateProperties.EMPTY).get(FloweringLeavesBlock.AGE);
return Objects.nonNull(integer) ? integer / 4.0F : 0.0F;
});
}

@Override
public void onInitializeClient() {
registerParticles();
registerRenderLayers();
registerBlockColors();
registerItemColors();
registerItemProperties();
}

}
Expand Down
72 changes: 72 additions & 0 deletions src/main/resources/assets/blossom/items/flowering_oak_leaves.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"model": {
"type": "minecraft:select",
"block_state_property": "age",
"cases": [
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/flowering_oak_leaves_stage0",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]

},
"when": "0"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/flowering_oak_leaves_stage1a",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "1"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/flowering_oak_leaves_stage2b",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "2"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/flowering_oak_leaves_stage3",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "3"
}
],
"fallback": {
"type": "minecraft:model",
"model": "blossom:block/flowering_oak_leaves_stage0",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"property": "minecraft:block_state"
}
}
123 changes: 123 additions & 0 deletions src/main/resources/assets/blossom/items/fruiting_oak_leaves.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"model": {
"type": "minecraft:select",
"block_state_property": "age",
"cases": [
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage0",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "0"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage1",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "1"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage2",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "2"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage3",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "3"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage4",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "4"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage5",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "5"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage6",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "6"
},
{
"model": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage7",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"when": "7"
}
],
"fallback": {
"type": "minecraft:model",
"model": "blossom:block/fruiting_oak_leaves_stage0",
"tints": [
{
"type": "minecraft:constant",
"value": -12012264
}
]
},
"property": "minecraft:block_state"
}
}

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

"depends": {
"fabricloader": ">=0.15.10",
"minecraft": ">1.21.1 <=1.21.3",
"minecraft": ">1.21.3",
"java": ">=17"
}
}

0 comments on commit 773e161

Please sign in to comment.