Modifies......
This commit is contained in:
parent
ad19d6ffa7
commit
839c0bb0f2
5
src/main/java/com/learning/Commands.java
Normal file
5
src/main/java/com/learning/Commands.java
Normal file
@ -0,0 +1,5 @@
|
||||
package com.learning;
|
||||
|
||||
public class Commands {
|
||||
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
package com.learning;
|
||||
|
||||
import com.learning.block.CustomBlocks;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.learning.item.CustomItem;
|
||||
import com.learning.item.CustomItems;
|
||||
import com.learning.itemgroup.CustomItemGroup;
|
||||
|
||||
public class Learning implements ModInitializer {
|
||||
@ -23,7 +24,8 @@ public class Learning implements ModInitializer {
|
||||
// Proceed with mild caution.
|
||||
|
||||
LOGGER.info("Hello Fabric world!");
|
||||
CustomItem.registerItems();
|
||||
CustomBlocks.registerBlocks();
|
||||
CustomItems.registerItems();
|
||||
CustomItemGroup.registerItemGroup();
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,6 @@ package com.learning.component;
|
||||
import net.minecraft.component.type.FoodComponent;
|
||||
|
||||
public class Foods {
|
||||
public static FoodComponent toastFood = new FoodComponent.Builder().nutrition(2).build();
|
||||
public static FoodComponent bakedToastFood = new FoodComponent.Builder().nutrition(6).build();
|
||||
public static FoodComponent toastFood = new FoodComponent.Builder().nutrition(2).saturationModifier(1f).build();
|
||||
public static FoodComponent bakedToastFood = new FoodComponent.Builder().nutrition(6).saturationModifier(1f).build();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import net.minecraft.util.Identifier;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.component.type.ConsumableComponents;
|
||||
|
||||
public class CustomItem {
|
||||
public class CustomItems {
|
||||
public static void registerItems() {
|
||||
Learning.LOGGER.info("Registering Items...");
|
||||
}
|
@ -2,7 +2,7 @@ package com.learning.itemgroup;
|
||||
|
||||
|
||||
import com.learning.Learning;
|
||||
import com.learning.item.CustomItem;
|
||||
import com.learning.item.CustomItems;
|
||||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
@ -18,17 +18,17 @@ public class CustomItemGroup {
|
||||
Learning.LOGGER.info("Registering ItemGroup...");
|
||||
Learning.LOGGER.info("Registering item into ItemGroups...");
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.FOOD_AND_DRINK).register(
|
||||
register -> register.add(CustomItem.toast)
|
||||
register -> register.add(CustomItems.toast)
|
||||
);
|
||||
}
|
||||
|
||||
public static ItemGroup customItemGroup = register("custom_itemgroup", ItemGroup.create(null, -1)
|
||||
.icon(() -> new ItemStack(CustomItem.toast))
|
||||
.icon(() -> new ItemStack(CustomItems.toast))
|
||||
.displayName(Text.translatable("itemGroup.learning.custom_itemgroup"))
|
||||
.entries((displayContext, entries) -> {
|
||||
entries.add(CustomItem.toast);
|
||||
entries.add(CustomItem.bakedToast);
|
||||
entries.add(CustomItem.damageBlock);
|
||||
entries.add(CustomItems.toast);
|
||||
entries.add(CustomItems.bakedToast);
|
||||
entries.add(CustomItems.damageBlock);
|
||||
})
|
||||
.build());
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "learning:damage_block"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
],
|
||||
"random_sequence": "learning:blocks/damage_block"
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"type": "minecraft:smoking",
|
||||
"category": "food",
|
||||
"cookingtime": 100,
|
||||
"experience": 0.35,
|
||||
"ingredient": "learning:toast",
|
||||
"result": {
|
||||
"id": "learning:baked_toast"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user