Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
refactor: more chimericlib updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chimericdream committed Oct 8, 2024
1 parent 2e6ac8d commit 62b4075
Show file tree
Hide file tree
Showing 104 changed files with 1,888 additions and 1,718 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ archives_base_name = minekea-fabric
fabric_version = 0.101.1+1.21
cloth_config_version = 15.0.128
mod_menu_version = 11.0.1
chimericlib_version = 1.0.0-alpha.20
chimericlib_version = 1.0.0-alpha.25

# Optional Dependencies
patchouli_version = 1.21-87-FABRIC
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"conditions": [
{
"block": "minekea:building/slabs/basalt_bricks",
"condition": "minecraft:block_state_property",
"properties": {
"type": "double"
}
}
],
"count": 2.0,
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minekea:building/slabs/basalt_bricks"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"conditions": [
{
"block": "minekea:building/slabs/cracked_basalt_bricks",
"condition": "minecraft:block_state_property",
"properties": {
"type": "double"
}
}
],
"count": 2.0,
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minekea:building/slabs/cracked_basalt_bricks"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"conditions": [
{
"block": "minekea:building/slabs/crimson_basalt_bricks",
"condition": "minecraft:block_state_property",
"properties": {
"type": "double"
}
}
],
"count": 2.0,
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minekea:building/slabs/crimson_basalt_bricks"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"conditions": [
{
"block": "minekea:building/slabs/mossy_basalt_bricks",
"condition": "minecraft:block_state_property",
"properties": {
"type": "double"
}
}
],
"count": 2.0,
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minekea:building/slabs/mossy_basalt_bricks"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"conditions": [
{
"block": "minekea:building/slabs/warped_basalt_bricks",
"condition": "minecraft:block_state_property",
"properties": {
"type": "double"
}
}
],
"count": 2.0,
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minekea:building/slabs/warped_basalt_bricks"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"conditions": [
{
"block": "minekea:building/slabs/warped_nether_bricks",
"condition": "minecraft:block_state_property",
"properties": {
"type": "double"
}
}
],
"count": 2.0,
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minekea:building/slabs/warped_nether_bricks"
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.chimericdream.minekea.block.building;

import com.chimericdream.lib.fabric.blocks.FabricModBlock;
import com.chimericdream.lib.util.Registerable;
import com.chimericdream.lib.blocks.BlockDataGenerator;
import com.chimericdream.lib.blocks.RegisterableBlock;
import com.chimericdream.lib.fabric.blocks.FabricBlockDataGenerator;
import com.chimericdream.minekea.block.building.beams.Beams;
import com.chimericdream.minekea.block.building.compressed.CompressedBlocks;
import com.chimericdream.minekea.block.building.covers.Covers;
Expand Down Expand Up @@ -59,9 +60,9 @@ public class BuildingBlocks implements MinekeaBlockCategory {
public static final Stairs STAIRS;
public static final StorageBlocks STORAGE_BLOCKS;
public static final Walls WALLS;
public static final Map<String, FabricModBlock> WAX_BLOCKS = new LinkedHashMap<>();
public static final Map<String, Block> WAX_BLOCKS = new LinkedHashMap<>();

private static final List<FabricModBlock> BLOCKS = new ArrayList<>();
private static final List<Block> BLOCKS = new ArrayList<>();
private static final List<MinekeaBlockCategory> BLOCK_GROUPS = new ArrayList<>();

static {
Expand Down Expand Up @@ -138,7 +139,7 @@ public void initializeClient() {

@Override
public void registerBlocks() {
BLOCKS.forEach(Registerable::register);
BLOCKS.forEach(block -> ((RegisterableBlock) block).register());
BLOCK_GROUPS.forEach(MinekeaBlockCategory::registerBlocks);

ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS)
Expand All @@ -165,49 +166,49 @@ public void registerEntities() {

@Override
public void configureBlockTags(RegistryWrapper.WrapperLookup registryLookup, Function<TagKey<Block>, FabricTagProvider<Block>.FabricTagBuilder> getBuilder) {
BLOCKS.forEach(block -> block.configureBlockTags(registryLookup, getBuilder));
BLOCKS.forEach(block -> ((FabricBlockDataGenerator) block).configureBlockTags(registryLookup, getBuilder));
BLOCK_GROUPS.forEach(group -> group.configureBlockTags(registryLookup, getBuilder));
}

@Override
public void configureItemTags(RegistryWrapper.WrapperLookup registryLookup, Function<TagKey<Item>, FabricTagProvider<Item>.FabricTagBuilder> getBuilder) {
BLOCKS.forEach(block -> block.configureItemTags(registryLookup, getBuilder));
BLOCKS.forEach(block -> ((FabricBlockDataGenerator) block).configureItemTags(registryLookup, getBuilder));
BLOCK_GROUPS.forEach(group -> group.configureItemTags(registryLookup, getBuilder));
}

@Override
public void configureRecipes(RecipeExporter exporter) {
BLOCKS.forEach(block -> block.configureRecipes(exporter));
BLOCKS.forEach(block -> ((BlockDataGenerator) block).configureRecipes(exporter));
BLOCK_GROUPS.forEach(group -> group.configureRecipes(exporter));
}

@Override
public void configureBlockLootTables(RegistryWrapper.WrapperLookup registryLookup, BlockLootTableGenerator generator) {
BLOCKS.forEach(block -> block.configureBlockLootTables(registryLookup, generator));
BLOCKS.forEach(block -> ((BlockDataGenerator) block).configureBlockLootTables(registryLookup, generator));
BLOCK_GROUPS.forEach(group -> group.configureBlockLootTables(registryLookup, generator));
}

@Override
public void configureTranslations(RegistryWrapper.WrapperLookup registryLookup, FabricLanguageProvider.TranslationBuilder translationBuilder) {
BLOCKS.forEach(block -> block.configureTranslations(registryLookup, translationBuilder));
BLOCKS.forEach(block -> ((FabricBlockDataGenerator) block).configureTranslations(registryLookup, translationBuilder));
BLOCK_GROUPS.forEach(group -> group.configureTranslations(registryLookup, translationBuilder));
}

@Override
public void configureBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) {
BLOCKS.forEach(block -> block.configureBlockStateModels(blockStateModelGenerator));
BLOCKS.forEach(block -> ((BlockDataGenerator) block).configureBlockStateModels(blockStateModelGenerator));
BLOCK_GROUPS.forEach(group -> group.configureBlockStateModels(blockStateModelGenerator));
}

@Override
public void configureItemModels(ItemModelGenerator itemModelGenerator) {
BLOCKS.forEach(block -> block.configureItemModels(itemModelGenerator));
BLOCKS.forEach(block -> ((BlockDataGenerator) block).configureItemModels(itemModelGenerator));
BLOCK_GROUPS.forEach(group -> group.configureItemModels(itemModelGenerator));
}

@Override
public void generateTextures() {
BLOCKS.forEach(FabricModBlock::generateTextures);
BLOCKS.forEach(block -> ((BlockDataGenerator) block).generateTextures());
BLOCK_GROUPS.forEach(MinekeaBlockCategory::generateTextures);
}
}
Loading

0 comments on commit 62b4075

Please sign in to comment.