This commit is contained in:
nelle 2023-01-07 01:42:36 -07:00
parent 17779e4591
commit 9d5def8db9
4 changed files with 44 additions and 3 deletions

View file

@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true org.gradle.parallel = true
# Mod Properties # Mod Properties
version = 1.0.0 version = 1.0.1
maven_group = xyz.limepot maven_group = xyz.limepot
archives_base_name = roses_mod archives_base_name = roses_mod

View file

@ -1,10 +1,14 @@
package xyz.limepot.roses_mod; package xyz.limepot.roses_mod;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderLayer;
import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.Items;
import net.minecraft.loot.LootPool;
import net.minecraft.loot.entry.ItemEntry;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
@ -35,8 +39,14 @@ public class RosesMod implements ModInitializer {
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "potted_rose"), POTTED_ROSE); Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "potted_rose"), POTTED_ROSE);
//RENDER LAYERS //LOOT TABLES
final Identifier ROSE_BUSH_LOOT_TABLE_ID = Blocks.ROSE_BUSH.getLootTableId();
LootTableEvents.MODIFY.register((resourceManager, lootManager, id, tableBuilder, source) -> {
if (source.isBuiltin() && ROSE_BUSH_LOOT_TABLE_ID.equals(id)) {
LootPool.Builder poolBuilder = LootPool.builder().with(ItemEntry.builder(RosesMod.ROSE_FLOWER));;
tableBuilder.pool(poolBuilder);
}
});
//INIT //INIT
LOGGER.info("Hello Quilt world from {}!", mod.metadata().name()); LOGGER.info("Hello Quilt world from {}!", mod.metadata().name());

View file

@ -0,0 +1,14 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 2,
"entries": [
{
"type": "minecraft:item",
"name": "roses_mod:rose_flower"
}
]
}
]
}

View file

@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
" WW",
" WW"
],
"key": {
"W": {
"item": "roses_mod:rose_flower"
}
},
"result": {
"item": "minecraft:rose_bush",
"count": 1
}
}