mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 07:17:58 +01:00
Added bowl of nuts, oatmeal cookie, and pinecone cookie
This commit is contained in:
parent
c0a64a80f1
commit
7cf32cce52
10 changed files with 43 additions and 9 deletions
|
@ -57,7 +57,7 @@ public class UModelProvider extends FabricModelProvider {
|
||||||
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
|
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
|
||||||
ItemModels.register(itemModelGenerator,
|
ItemModels.register(itemModelGenerator,
|
||||||
UItems.ACORN, UItems.APPLE_PIE_HOOF, UItems.APPLE_PIE_SLICE, UItems.APPLE_PIE,
|
UItems.ACORN, UItems.APPLE_PIE_HOOF, UItems.APPLE_PIE_SLICE, UItems.APPLE_PIE,
|
||||||
UItems.BANANA, UItems.BOTCHED_GEM, UItems.BROKEN_SUNGLASSES, UItems.BURNED_JUICE, UItems.BURNED_TOAST,
|
UItems.BANANA, UItems.BOTCHED_GEM, UItems.BOWL_OF_NUTS, UItems.BROKEN_SUNGLASSES, UItems.BURNED_JUICE, UItems.BURNED_TOAST,
|
||||||
UItems.CARAPACE, UItems.CLAM_SHELL, UItems.COOKED_ZAP_APPLE, UItems.CLOUD_LUMP, UItems.CRISPY_HAY_FRIES, UItems.CRYSTAL_HEART, UItems.CRYSTAL_SHARD,
|
UItems.CARAPACE, UItems.CLAM_SHELL, UItems.COOKED_ZAP_APPLE, UItems.CLOUD_LUMP, UItems.CRISPY_HAY_FRIES, UItems.CRYSTAL_HEART, UItems.CRYSTAL_SHARD,
|
||||||
UItems.DAFFODIL_DAISY_SANDWICH, UItems.DRAGON_BREATH_SCROLL,
|
UItems.DAFFODIL_DAISY_SANDWICH, UItems.DRAGON_BREATH_SCROLL,
|
||||||
UItems.EMPTY_JAR,
|
UItems.EMPTY_JAR,
|
||||||
|
@ -69,8 +69,8 @@ public class UModelProvider extends FabricModelProvider {
|
||||||
UItems.JAM_TOAST, UItems.JUICE,
|
UItems.JAM_TOAST, UItems.JUICE,
|
||||||
UItems.LIGHTNING_JAR,
|
UItems.LIGHTNING_JAR,
|
||||||
UItems.MANGO, UItems.MUFFIN,
|
UItems.MANGO, UItems.MUFFIN,
|
||||||
UItems.OATMEAL,
|
UItems.OATMEAL, UItems.OATMEAL_COOKIE,
|
||||||
UItems.PEBBLES, UItems.PEGASUS_FEATHER, UItems.PINECONE, UItems.PINEAPPLE_CROWN,
|
UItems.PEBBLES, UItems.PEGASUS_FEATHER, UItems.PINECONE, UItems.PINECONE_COOKIE, UItems.PINEAPPLE_CROWN,
|
||||||
UItems.RAIN_CLOUD_JAR, UItems.ROCK_STEW, UItems.ROCK, UItems.ROTTEN_APPLE,
|
UItems.RAIN_CLOUD_JAR, UItems.ROCK_STEW, UItems.ROCK, UItems.ROTTEN_APPLE,
|
||||||
UItems.SALT_CUBE, UItems.SCALLOP_SHELL, UItems.SHELLY, UItems.SOUR_APPLE_SEEDS, UItems.SOUR_APPLE, UItems.SPELLBOOK, UItems.STORM_CLOUD_JAR,
|
UItems.SALT_CUBE, UItems.SCALLOP_SHELL, UItems.SHELLY, UItems.SOUR_APPLE_SEEDS, UItems.SOUR_APPLE, UItems.SPELLBOOK, UItems.STORM_CLOUD_JAR,
|
||||||
UItems.SWEET_APPLE_SEEDS, UItems.SWEET_APPLE,
|
UItems.SWEET_APPLE_SEEDS, UItems.SWEET_APPLE,
|
||||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.data.server.loottable.BlockLootTableGenerator;
|
import net.minecraft.data.server.loottable.BlockLootTableGenerator;
|
||||||
import net.minecraft.enchantment.Enchantments;
|
import net.minecraft.enchantment.Enchantments;
|
||||||
|
import net.minecraft.item.ItemConvertible;
|
||||||
import net.minecraft.loot.LootPool;
|
import net.minecraft.loot.LootPool;
|
||||||
import net.minecraft.loot.LootTable;
|
import net.minecraft.loot.LootTable;
|
||||||
import net.minecraft.loot.condition.LootCondition;
|
import net.minecraft.loot.condition.LootCondition;
|
||||||
|
@ -54,18 +55,29 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid
|
||||||
addVanillaDrop(Blocks.PODZOL, block -> wormDrops(block, 4, 0.06F, 0.062222223F, 0.065F, 0.077777776F, 0.2F));
|
addVanillaDrop(Blocks.PODZOL, block -> wormDrops(block, 4, 0.06F, 0.062222223F, 0.065F, 0.077777776F, 0.2F));
|
||||||
addVanillaDrop(Blocks.DIAMOND_ORE, this::crystalShardDrops);
|
addVanillaDrop(Blocks.DIAMOND_ORE, this::crystalShardDrops);
|
||||||
addVanillaDrop(Blocks.DEEPSLATE_DIAMOND_ORE, this::crystalShardDrops);
|
addVanillaDrop(Blocks.DEEPSLATE_DIAMOND_ORE, this::crystalShardDrops);
|
||||||
|
addVanillaDrop(Blocks.OAK_LEAVES, block -> chanceDropWithShears(block, UItems.ACORN, GEMSTONES_FORTUNE_CHANCE));
|
||||||
|
addVanillaDrop(Blocks.SPRUCE_LEAVES, block -> chanceDropWithShears(block, UItems.PINECONE, GEMSTONES_FORTUNE_CHANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addVanillaDrop(Block block, Function<Block, LootTable.Builder> lootTableFunction) {
|
private void addVanillaDrop(Block block, Function<Block, LootTable.Builder> lootTableFunction) {
|
||||||
lootTables.put(new Identifier("unicopiamc", block.getLootTableId().getPath()), lootTableFunction.apply(block));
|
lootTables.put(new Identifier("unicopiamc", block.getLootTableId().getPath()), lootTableFunction.apply(block));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LootTable.Builder chanceDropWithShears(Block block, ItemConvertible drop, float...chance) {
|
||||||
|
return LootTable.builder()
|
||||||
|
.pool(LootPool.builder()
|
||||||
|
.rolls(ConstantLootNumberProvider.create(1))
|
||||||
|
.conditionally(WITHOUT_SILK_TOUCH.and(WITH_SHEARS))
|
||||||
|
.with(chanceDrops(block, drop, 1, chance))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public LootTable.Builder wormDrops(Block block, int max, float...chance) {
|
public LootTable.Builder wormDrops(Block block, int max, float...chance) {
|
||||||
return LootTable.builder()
|
return LootTable.builder()
|
||||||
.pool(LootPool.builder()
|
.pool(LootPool.builder()
|
||||||
.rolls(ConstantLootNumberProvider.create(1))
|
.rolls(ConstantLootNumberProvider.create(1))
|
||||||
.conditionally(WITHOUT_SILK_TOUCH)
|
.conditionally(WITHOUT_SILK_TOUCH)
|
||||||
.with(wheatwormDrops(block, max, chance))
|
.with(chanceDrops(block, UItems.WHEAT_WORMS, max, chance))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +87,7 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid
|
||||||
.rolls(ConstantLootNumberProvider.create(1))
|
.rolls(ConstantLootNumberProvider.create(1))
|
||||||
.conditionally(WITHOUT_SILK_TOUCH)
|
.conditionally(WITHOUT_SILK_TOUCH)
|
||||||
.with(gemstoneDrops(block, 0.1F))
|
.with(gemstoneDrops(block, 0.1F))
|
||||||
.with(wheatwormDrops(block, max, chance))
|
.with(chanceDrops(block, UItems.WHEAT_WORMS, max, chance))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,16 +123,14 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid
|
||||||
.conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, GEMSTONES_FORTUNE_CHANCE));
|
.conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, GEMSTONES_FORTUNE_CHANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
public LootPoolEntry.Builder<?> wheatwormDrops(Block block, int max, float...chance) {
|
public LootPoolEntry.Builder<?> chanceDrops(Block block, ItemConvertible drop, int max, float...chance) {
|
||||||
return applyExplosionDecay(block, ItemEntry.builder(UItems.WHEAT_WORMS)
|
return applyExplosionDecay(block, ItemEntry.builder(drop)
|
||||||
.apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, max)))
|
.apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, max)))
|
||||||
)
|
)
|
||||||
.conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, chance));
|
.conditionally(TableBonusLootCondition.builder(Enchantments.FORTUNE, chance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static LootTable.Builder dropsWithGemfinding(Block drop, LootPoolEntry.Builder<?> child) {
|
public static LootTable.Builder dropsWithGemfinding(Block drop, LootPoolEntry.Builder<?> child) {
|
||||||
return BlockLootTableGenerator.drops(drop, WITHOUT_SILK_TOUCH_AND_GEM_FINDER, child);
|
return BlockLootTableGenerator.drops(drop, WITHOUT_SILK_TOUCH_AND_GEM_FINDER, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,6 +315,17 @@ public class URecipeProvider extends FabricRecipeProvider {
|
||||||
.input(UItems.ROCK, 3).criterion(hasItem(UItems.ROCK), conditionsFromItem(UItems.ROCK))
|
.input(UItems.ROCK, 3).criterion(hasItem(UItems.ROCK), conditionsFromItem(UItems.ROCK))
|
||||||
.input(Items.BOWL)
|
.input(Items.BOWL)
|
||||||
.offerTo(exporter);
|
.offerTo(exporter);
|
||||||
|
ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.BOWL_OF_NUTS)
|
||||||
|
.input(UItems.ACORN, 3).criterion(hasItem(UItems.ACORN), conditionsFromItem(UItems.ACORN))
|
||||||
|
.input(Items.BOWL)
|
||||||
|
.offerTo(exporter);
|
||||||
|
ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.OATMEAL_COOKIE)
|
||||||
|
.input(UItems.OATS, 3).criterion(hasItem(UItems.OATS), conditionsFromItem(UItems.OATS))
|
||||||
|
.offerTo(exporter);
|
||||||
|
ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.PINECONE_COOKIE)
|
||||||
|
.input(UItems.PINECONE).criterion(hasItem(UItems.PINECONE), conditionsFromItem(UItems.PINECONE))
|
||||||
|
.input(Items.WHEAT, 2)
|
||||||
|
.offerTo(exporter);
|
||||||
ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.ROCK_CANDY, 3)
|
ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.ROCK_CANDY, 3)
|
||||||
.input(Items.SUGAR, 6).criterion(hasItem(Items.SUGAR), conditionsFromItem(Items.SUGAR))
|
.input(Items.SUGAR, 6).criterion(hasItem(Items.SUGAR), conditionsFromItem(Items.SUGAR))
|
||||||
.input(UItems.PEBBLES, 3)
|
.input(UItems.PEBBLES, 3)
|
||||||
|
|
|
@ -75,6 +75,10 @@ public interface UItems {
|
||||||
Item IMPORTED_OATS = register("imported_oats", new Item(new Item.Settings().food(UFoodComponents.IMPORTED_OATS)), ItemGroups.FOOD_AND_DRINK);
|
Item IMPORTED_OATS = register("imported_oats", new Item(new Item.Settings().food(UFoodComponents.IMPORTED_OATS)), ItemGroups.FOOD_AND_DRINK);
|
||||||
Item OATMEAL = register("oatmeal", new OatmealItem(new Item.Settings().recipeRemainder(Items.BOWL).maxCount(1).food(UFoodComponents.OATMEAL)), ItemGroups.FOOD_AND_DRINK);
|
Item OATMEAL = register("oatmeal", new OatmealItem(new Item.Settings().recipeRemainder(Items.BOWL).maxCount(1).food(UFoodComponents.OATMEAL)), ItemGroups.FOOD_AND_DRINK);
|
||||||
|
|
||||||
|
Item OATMEAL_COOKIE = register("oatmeal_cookie", new Item(new Item.Settings().food(FoodComponents.COOKIE)), ItemGroups.FOOD_AND_DRINK);
|
||||||
|
Item PINECONE_COOKIE = register("pinecone_cookie", new Item(new Item.Settings().food(FoodComponents.COOKIE)), ItemGroups.FOOD_AND_DRINK);
|
||||||
|
Item BOWL_OF_NUTS = register("bowl_of_nuts", new StewItem(new Item.Settings().food(FoodComponents.BAKED_POTATO).recipeRemainder(Items.BOWL)), ItemGroups.FOOD_AND_DRINK);
|
||||||
|
|
||||||
Item DAFFODIL_DAISY_SANDWICH = register("daffodil_daisy_sandwich", new Item(new Item.Settings().food(UFoodComponents.DAFODIL_DAISY_SANDWICH)), ItemGroups.FOOD_AND_DRINK);
|
Item DAFFODIL_DAISY_SANDWICH = register("daffodil_daisy_sandwich", new Item(new Item.Settings().food(UFoodComponents.DAFODIL_DAISY_SANDWICH)), ItemGroups.FOOD_AND_DRINK);
|
||||||
Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().maxCount(1).food(UFoodComponents.HAY_BURGER)), ItemGroups.FOOD_AND_DRINK);
|
Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().maxCount(1).food(UFoodComponents.HAY_BURGER)), ItemGroups.FOOD_AND_DRINK);
|
||||||
Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.HAY_FRIES)), ItemGroups.FOOD_AND_DRINK);
|
Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().maxCount(16).food(UFoodComponents.HAY_FRIES)), ItemGroups.FOOD_AND_DRINK);
|
||||||
|
|
|
@ -146,6 +146,9 @@
|
||||||
"item.unicopia.horse_shoe_fries": "Horse Shoe Fries",
|
"item.unicopia.horse_shoe_fries": "Horse Shoe Fries",
|
||||||
"item.unicopia.wheat_worms": "Wheat Worms",
|
"item.unicopia.wheat_worms": "Wheat Worms",
|
||||||
"item.unicopia.muffin": "Muffin",
|
"item.unicopia.muffin": "Muffin",
|
||||||
|
"item.unicopia.oatmeal_cookie": "Oatmeal Cookie",
|
||||||
|
"item.unicopia.pinecone_cookie": "Pinecone Cookie",
|
||||||
|
"item.unicopia.bowl_of_nuts": "Bowl of Nuts",
|
||||||
|
|
||||||
"item.unicopia.pegasus_amulet": "Wings of Icarus",
|
"item.unicopia.pegasus_amulet": "Wings of Icarus",
|
||||||
"item.unicopia.pegasus_amulet.lore": "Grants temporary flight to whoever wears it",
|
"item.unicopia.pegasus_amulet.lore": "Grants temporary flight to whoever wears it",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
|
@ -17,6 +17,9 @@
|
||||||
"unicopia:hay_fries",
|
"unicopia:hay_fries",
|
||||||
"unicopia:crispy_hay_fries",
|
"unicopia:crispy_hay_fries",
|
||||||
"unicopia:horse_shoe_fries",
|
"unicopia:horse_shoe_fries",
|
||||||
|
"unicopia:oatmeal_cookie",
|
||||||
|
"unicopia:pinecone_cookie",
|
||||||
|
"unicopia:bowl_of_nuts",
|
||||||
{ "id": "farmersdelight:wheat_dough", "required": false },
|
{ "id": "farmersdelight:wheat_dough", "required": false },
|
||||||
{ "id": "farmersdelight:raw_pasta", "required": false },
|
{ "id": "farmersdelight:raw_pasta", "required": false },
|
||||||
{ "id": "farmersdelight:pie_crust", "required": false },
|
{ "id": "farmersdelight:pie_crust", "required": false },
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
"unicopia:oats",
|
"unicopia:oats",
|
||||||
"unicopia:imported_oats",
|
"unicopia:imported_oats",
|
||||||
"unicopia:oatmeal",
|
"unicopia:oatmeal",
|
||||||
|
"unicopia:oatmeal_cookie",
|
||||||
"unicopia:daffodil_daisy_sandwich",
|
"unicopia:daffodil_daisy_sandwich",
|
||||||
"unicopia:hay_burger",
|
"unicopia:hay_burger",
|
||||||
"unicopia:hay_fries",
|
"unicopia:hay_fries",
|
||||||
|
@ -61,6 +62,8 @@
|
||||||
"unicopia:muffin",
|
"unicopia:muffin",
|
||||||
"unicopia:acorn",
|
"unicopia:acorn",
|
||||||
"unicopia:pinecone",
|
"unicopia:pinecone",
|
||||||
|
"unicopia:pinecone_cookie",
|
||||||
|
"unicopia:bowl_of_nuts",
|
||||||
"unicopia:crystal_shard",
|
"unicopia:crystal_shard",
|
||||||
"unicopia:pebbles",
|
"unicopia:pebbles",
|
||||||
"unicopia:rock",
|
"unicopia:rock",
|
||||||
|
|
Loading…
Reference in a new issue