diff --git a/src/generated/resources/.cache/2ac56fe60cdf0cd798eb1c9904c9821512b5e8c3 b/src/generated/resources/.cache/2ac56fe60cdf0cd798eb1c9904c9821512b5e8c3 index 0deb820c..e83122ac 100644 --- a/src/generated/resources/.cache/2ac56fe60cdf0cd798eb1c9904c9821512b5e8c3 +++ b/src/generated/resources/.cache/2ac56fe60cdf0cd798eb1c9904c9821512b5e8c3 @@ -1,2 +1,2 @@ // 1.20.1 2024-03-03T00:02:51.8603782 SwitchCraft Goodies/Language (en_us) -ad375c4fbf1587e4777082b8de680e14fa0c6229 assets\sc-goodies\lang\en_us.json +ad375c4fbf1587e4777082b8de680e14fa0c6229 assets\sc-goodies\lang\en_us.json \ No newline at end of file diff --git a/src/generated/resources/.cache/8dddb602b6fc23bde80dd2fdb61e97cf507d1fd6 b/src/generated/resources/.cache/8dddb602b6fc23bde80dd2fdb61e97cf507d1fd6 index 8313c09f..d630a099 100644 --- a/src/generated/resources/.cache/8dddb602b6fc23bde80dd2fdb61e97cf507d1fd6 +++ b/src/generated/resources/.cache/8dddb602b6fc23bde80dd2fdb61e97cf507d1fd6 @@ -2,4 +2,4 @@ 88d7dc2cda0c954363240835dc1a120029372d59 data\sc-goodies\worldgen\configured_feature\sakura_tree.json 47a33ebe7bddd1495b3b1a3556af0f771adb573d data\sc-goodies\damage_type\barrel_hammer.json 045ca36b6362d3383065d80bdd4ebb7601b985c7 data\sc-goodies\worldgen\configured_feature\maple_tree.json -9af415ba7d9772ed4f4c83b7aefe9081d85afb06 data\sc-goodies\worldgen\configured_feature\blue_tree.json +9af415ba7d9772ed4f4c83b7aefe9081d85afb06 data\sc-goodies\worldgen\configured_feature\blue_tree.json \ No newline at end of file diff --git a/src/generated/resources/.cache/c2d4f06d6dbced8ac5764fdbef726f95d8dfcf32 b/src/generated/resources/.cache/c2d4f06d6dbced8ac5764fdbef726f95d8dfcf32 index 765df5ed..6c5ccb98 100644 --- a/src/generated/resources/.cache/c2d4f06d6dbced8ac5764fdbef726f95d8dfcf32 +++ b/src/generated/resources/.cache/c2d4f06d6dbced8ac5764fdbef726f95d8dfcf32 @@ -10,4 +10,4 @@ d271db8ff8e5339b949a85bdfd38e23238b785b2 data\minecraft\tags\blocks\mineable\pic 9add93461267d841a135d57165b955ef109901c1 data\minecraft\tags\blocks\dirt.json 864839e4fdbc62745fcce9b3d37e3d0900b3cf7b data\minecraft\tags\blocks\completes_find_tree_tutorial.json 45e38aae59c74c989644f2ae230ccd8431bfc202 data\minecraft\tags\blocks\saplings.json -9add93461267d841a135d57165b955ef109901c1 data\minecraft\tags\blocks\mineable\shovel.json +9add93461267d841a135d57165b955ef109901c1 data\minecraft\tags\blocks\mineable\shovel.json \ No newline at end of file diff --git a/src/generated/resources/assets/sc-goodies/lang/en_us.json b/src/generated/resources/assets/sc-goodies/lang/en_us.json index 2e78c7e0..9f5a9c70 100644 --- a/src/generated/resources/assets/sc-goodies/lang/en_us.json +++ b/src/generated/resources/assets/sc-goodies/lang/en_us.json @@ -187,6 +187,22 @@ "item.sc-goodies.gold_diamond_chest_upgrade.desc": "Upgrade Gold chests, barrels, or shulker boxes to\nDiamond chests, barrels, or shulker boxes.", "item.sc-goodies.hover_boots": "Hover Boots", "item.sc-goodies.hover_boots.desc": "Allows you to jump higher.", + "item.sc-goodies.icecream_beetroot": "Beetroot Ice Cream", + "item.sc-goodies.icecream_beetroot.desc": "An earthy treat!", + "item.sc-goodies.icecream_chocolate": "Chocolate Ice Cream", + "item.sc-goodies.icecream_chocolate.desc": "A delicious treat!", + "item.sc-goodies.icecream_melon": "Melon Ice Cream", + "item.sc-goodies.icecream_melon.desc": "A delicious treat!", + "item.sc-goodies.icecream_neapolitan": "Neapolitan Ice Cream", + "item.sc-goodies.icecream_neapolitan.desc": "Vanilla, Chocolate, and Sweet Berry.", + "item.sc-goodies.icecream_spruce": "Spruce Ice Cream", + "item.sc-goodies.icecream_spruce.desc": "A refreshing treat!", + "item.sc-goodies.icecream_sundae": "Triple Gooberberry Sunrise", + "item.sc-goodies.icecream_sundae.desc": "A suspiciously familiar sundae.", + "item.sc-goodies.icecream_sweetberry": "Sweet Berry Ice Cream", + "item.sc-goodies.icecream_sweetberry.desc": "A delicious treat!", + "item.sc-goodies.icecream_vanilla": "Vanilla Ice Cream", + "item.sc-goodies.icecream_vanilla.desc": "A delicious treat!", "item.sc-goodies.iron_diamond_chest_upgrade": "Iron to Diamond Storage Upgrade", "item.sc-goodies.iron_diamond_chest_upgrade.desc": "Upgrade Iron chests, barrels, or shulker boxes to\nDiamond chests, barrels, or shulker boxes.", "item.sc-goodies.iron_gold_chest_upgrade": "Iron to Gold Storage Upgrade", diff --git a/src/main/kotlin/io/sc3/goodies/Registration.kt b/src/main/kotlin/io/sc3/goodies/Registration.kt index 7e2b59f5..e5f024b6 100644 --- a/src/main/kotlin/io/sc3/goodies/Registration.kt +++ b/src/main/kotlin/io/sc3/goodies/Registration.kt @@ -391,13 +391,25 @@ object Registration { val dragonScale = rItem("dragon_scale", BaseItem(itemSettings() .maxCount(16) .rarity(EPIC))) - val popcorn = rItem("popcorn", PopcornItem(itemSettings() - .food(PopcornItem.foodComponent) - .maxCount(1))) val ancientTome = rItem("ancient_tome", AncientTomeItem(itemSettings() .maxCount(1) .rarity(UNCOMMON))) + val popcorn = rItem("popcorn", PopcornItem(itemSettings() + .food(PopcornItem.foodComponent) + .maxCount(1))) + val iceCreamVanilla = rIceCreamItem("icecream_vanilla") + val iceCreamChocolate = rIceCreamItem("icecream_chocolate") + val iceCreamSweetBerry = rIceCreamItem("icecream_sweetberry") + val iceCreamNeapolitan = rIceCreamItem("icecream_neapolitan") + val iceCreamSpruce = rIceCreamItem("icecream_spruce") + val iceCreamMelon = rIceCreamItem("icecream_melon") + val iceCreamBeetroot = rIceCreamItem("icecream_beetroot") + // This is a bit messy, but a much simpler way to have the sundae be worth more food + val iceCreamSundae = rItem("icecream_sundae", IceCreamItem(itemSettings() + .food(FoodComponent.Builder().hunger(7).saturationModifier(8.0f).alwaysEdible().build()) + .maxCount(16))) + val dimmableLight = rItem(ModBlocks.dimmableLight, ::BlockItem, itemSettings()) // TODO: Clean up @@ -414,6 +426,10 @@ object Registration { fun rItem(name: String, value: T): T = register(ITEM, ModId(name), value).also { items.add(it) } + private fun rIceCreamItem(name: String): Item = rItem(name, IceCreamItem(itemSettings() + .food(IceCreamItem.foodComponent) + .maxCount(16))) + fun rItem(parent: B, supplier: (B, Item.Settings) -> I, settings: Item.Settings = itemSettings()): I { val item = register(ITEM, BLOCK.getId(parent), supplier(parent, settings)) diff --git a/src/main/kotlin/io/sc3/goodies/datagen/LanguageProvider.kt b/src/main/kotlin/io/sc3/goodies/datagen/LanguageProvider.kt index fb989a6a..b98c24a0 100644 --- a/src/main/kotlin/io/sc3/goodies/datagen/LanguageProvider.kt +++ b/src/main/kotlin/io/sc3/goodies/datagen/LanguageProvider.kt @@ -138,6 +138,24 @@ class LanguageProvider(out: FabricDataOutput) : FabricLanguageProvider(out) { builder.add(ModItems.popcorn, "Popcorn") builder.sub(ModItems.popcorn, "A bottomless bag of popcorn.") + + builder.add(ModItems.iceCreamVanilla, "Vanilla Ice Cream") + builder.sub(ModItems.iceCreamVanilla, "A delicious treat!") + builder.add(ModItems.iceCreamChocolate, "Chocolate Ice Cream") + builder.sub(ModItems.iceCreamChocolate, "A delicious treat!") + builder.add(ModItems.iceCreamSweetBerry, "Sweet Berry Ice Cream") + builder.sub(ModItems.iceCreamSweetBerry, "A delicious treat!") + builder.add(ModItems.iceCreamNeapolitan, "Neapolitan Ice Cream") + builder.sub(ModItems.iceCreamNeapolitan, "Vanilla, Chocolate, and Sweet Berry.") + builder.add(ModItems.iceCreamSpruce, "Spruce Ice Cream") + builder.sub(ModItems.iceCreamSpruce, "A refreshing treat!") + builder.add(ModItems.iceCreamMelon, "Melon Ice Cream") + builder.sub(ModItems.iceCreamMelon, "A delicious treat!") + builder.add(ModItems.iceCreamBeetroot, "Beetroot Ice Cream") + builder.sub(ModItems.iceCreamBeetroot, "An earthy treat!") + builder.add(ModItems.iceCreamSundae, "Triple Gooberberry Sunrise") + builder.sub(ModItems.iceCreamSundae, "A suspiciously familiar sundae.") + builder.add(ModItems.glassItemFrame, "Glass Item Frame") builder.sub(ModItems.glassItemFrame, "An item frame with an invisible background when it contains an item.") builder.add(ModItems.glowGlassItemFrame, "Glow Glass Item Frame") diff --git a/src/main/kotlin/io/sc3/goodies/datagen/ModelProvider.kt b/src/main/kotlin/io/sc3/goodies/datagen/ModelProvider.kt index 210a23db..0fdc11cf 100644 --- a/src/main/kotlin/io/sc3/goodies/datagen/ModelProvider.kt +++ b/src/main/kotlin/io/sc3/goodies/datagen/ModelProvider.kt @@ -82,6 +82,15 @@ class ModelProvider(out: FabricDataOutput) : FabricModelProvider(out) { gen.register(ModItems.glassItemFrame, GENERATED) gen.register(ModItems.glowGlassItemFrame, GENERATED) + gen.register(ModItems.iceCreamVanilla, GENERATED) + gen.register(ModItems.iceCreamChocolate, GENERATED) + gen.register(ModItems.iceCreamSweetBerry, GENERATED) + gen.register(ModItems.iceCreamNeapolitan, GENERATED) + gen.register(ModItems.iceCreamSpruce, GENERATED) + gen.register(ModItems.iceCreamMelon, GENERATED) + gen.register(ModItems.iceCreamBeetroot, GENERATED) + gen.register(ModItems.iceCreamSundae, GENERATED) + // Dyed + Special Elytra DyedElytraItem.dyedElytraItems.values .forEach { gen.register(it, GENERATED) } diff --git a/src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/IceCreamRecipes.kt b/src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/IceCreamRecipes.kt new file mode 100644 index 00000000..0f140c13 --- /dev/null +++ b/src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/IceCreamRecipes.kt @@ -0,0 +1,104 @@ +package io.sc3.goodies.datagen.recipes.handlers + +import io.sc3.goodies.Registration.ModItems +import io.sc3.library.recipe.RecipeHandler +import net.minecraft.data.server.recipe.RecipeJsonProvider +import net.minecraft.data.server.recipe.RecipeProvider +import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder +import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder +import net.minecraft.item.Item +import net.minecraft.item.Items.* +import net.minecraft.recipe.Ingredient +import net.minecraft.recipe.book.RecipeCategory +import net.minecraft.registry.Registries +import java.util.function.Consumer + +object IceCreamRecipes : RecipeHandler { + fun iceCreamRecipe(ingredientA: Ingredient, ingredientB: Ingredient, makes: Item, exporter: Consumer) { + ShapedRecipeJsonBuilder + .create(RecipeCategory.FOOD, makes) + .pattern("ASB") + .pattern("SsS") + .pattern("mbe") + .input('S', SNOWBALL) + .input('s', SUGAR) + .input('m', MILK_BUCKET) + .input('b', BOWL) + .input('e', EGG) + .input('A', ingredientA) + .input('B', ingredientB) + .criterion("has_snowball", RecipeProvider.conditionsFromItem(SNOWBALL)) + .offerTo(exporter) + ShapelessRecipeJsonBuilder + .create(RecipeCategory.FOOD, makes) + .input(ModItems.iceCreamVanilla) + .input(ingredientA) + .input(ingredientB) + .criterion("has_icecream_vanilla", RecipeProvider.conditionsFromItem(ModItems.iceCreamVanilla)) + .offerTo(exporter, Registries.ITEM.getId(makes.asItem()).path + "_from_vanilla") + } + + override fun generateRecipes(exporter: Consumer) { + // Ice Cream + ShapedRecipeJsonBuilder + .create(RecipeCategory.FOOD, ModItems.iceCreamVanilla) + .pattern(" S ") + .pattern("SsS") + .pattern("mbe") + .input('S', SNOWBALL) + .input('s', SUGAR) + .input('m', MILK_BUCKET) + .input('b', BOWL) + .input('e', EGG) + .criterion("has_snowball", RecipeProvider.conditionsFromItem(SNOWBALL)) + .offerTo(exporter) + + iceCreamRecipe( + Ingredient.ofItems(COCOA_BEANS), + Ingredient.ofItems(COCOA_BEANS), + ModItems.iceCreamChocolate, exporter + ) + iceCreamRecipe( + Ingredient.ofItems(SWEET_BERRIES), + Ingredient.ofItems(SWEET_BERRIES), + ModItems.iceCreamSweetBerry, exporter + ) + iceCreamRecipe( + Ingredient.ofItems(SPRUCE_SAPLING, SPRUCE_LEAVES), + Ingredient.ofItems(SPRUCE_SAPLING, SPRUCE_LEAVES), + ModItems.iceCreamSpruce, exporter + ) + iceCreamRecipe( + Ingredient.ofItems(MELON_SLICE), + Ingredient.ofItems(MELON_SLICE), + ModItems.iceCreamMelon, exporter + ) + iceCreamRecipe( + Ingredient.ofItems(BEETROOT), + Ingredient.ofItems(BEETROOT), + ModItems.iceCreamBeetroot, exporter + ) + + //Sundae Recipe + ShapedRecipeJsonBuilder + .create(RecipeCategory.FOOD, ModItems.iceCreamSundae) + .pattern(" b ") + .pattern("bSb") + .pattern("SvS") + .input('v', ModItems.iceCreamVanilla) + .input('S', GOLDEN_CARROT) + .input('b', SWEET_BERRIES) + .criterion("has_icecream_vanilla", RecipeProvider.conditionsFromItem(ModItems.iceCreamVanilla)) + .offerTo(exporter) + //Neapolitan Recipe + ShapelessRecipeJsonBuilder + .create(RecipeCategory.FOOD, ModItems.iceCreamNeapolitan, 3) + .input(ModItems.iceCreamVanilla) + .input(ModItems.iceCreamChocolate) + .input(ModItems.iceCreamSweetBerry) + .criterion("has_icecream_vanilla", RecipeProvider.conditionsFromItem(ModItems.iceCreamVanilla)) + .criterion("has_icecream_chocolate", RecipeProvider.conditionsFromItem(ModItems.iceCreamChocolate)) + .criterion("has_icecream_sweetberry", RecipeProvider.conditionsFromItem(ModItems.iceCreamSweetBerry)) + .offerTo(exporter) + } +} diff --git a/src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/RecipeHandlers.kt b/src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/RecipeHandlers.kt index 15bcb664..b0ff665c 100644 --- a/src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/RecipeHandlers.kt +++ b/src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/RecipeHandlers.kt @@ -14,5 +14,6 @@ val RECIPE_HANDLERS by lazy { listOf( ItemFrameRecipes, AmethystRecipes, DimmableLightRecipe, - ColorfulGrassRecipes + ColorfulGrassRecipes, + IceCreamRecipes )} diff --git a/src/main/kotlin/io/sc3/goodies/misc/IceCreamItem.kt b/src/main/kotlin/io/sc3/goodies/misc/IceCreamItem.kt new file mode 100644 index 00000000..e8b28530 --- /dev/null +++ b/src/main/kotlin/io/sc3/goodies/misc/IceCreamItem.kt @@ -0,0 +1,35 @@ +package io.sc3.goodies.misc + +import net.minecraft.entity.LivingEntity +import net.minecraft.item.FoodComponent +import net.minecraft.item.ItemStack +import net.minecraft.world.World +import io.sc3.goodies.util.BaseItem +import net.minecraft.entity.player.PlayerEntity +import net.minecraft.item.Items + +class IceCreamItem(settings: Settings) : BaseItem(settings) { + override fun finishUsing(stack: ItemStack, world: World, user: LivingEntity): ItemStack { + // Return Bowl + if (user is PlayerEntity && !user.isCreative) { + user.inventory.offerOrDrop(ItemStack(Items.BOWL)) + } + return super.finishUsing(stack, world, user) + } + + override fun usageTick(world: World?, user: LivingEntity?, stack: ItemStack?, remainingUseTicks: Int) { + // if player is eating while full hunger, start doing brainfreeze! + if (user is PlayerEntity && !user.isCreative && !user.hungerManager.isNotFull) { + user.frozenTicks += 3 + } + super.usageTick(world, user, stack, remainingUseTicks) + } + + companion object { + val foodComponent: FoodComponent = FoodComponent.Builder() + .hunger(4) + .saturationModifier(5.0f) + .alwaysEdible() + .build() + } +} diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_beetroot.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_beetroot.png new file mode 100644 index 00000000..2cedfeb0 Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_beetroot.png differ diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_chocolate.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_chocolate.png new file mode 100644 index 00000000..f5785382 Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_chocolate.png differ diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_melon.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_melon.png new file mode 100644 index 00000000..e2f8982e Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_melon.png differ diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_neapolitan.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_neapolitan.png new file mode 100644 index 00000000..6b662ca6 Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_neapolitan.png differ diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_spruce.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_spruce.png new file mode 100644 index 00000000..fba6eee8 Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_spruce.png differ diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_sundae.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_sundae.png new file mode 100644 index 00000000..155e8d0a Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_sundae.png differ diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_sweetberry.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_sweetberry.png new file mode 100644 index 00000000..1aee6831 Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_sweetberry.png differ diff --git a/src/main/resources/assets/sc-goodies/textures/item/icecream_vanilla.png b/src/main/resources/assets/sc-goodies/textures/item/icecream_vanilla.png new file mode 100644 index 00000000..650de993 Binary files /dev/null and b/src/main/resources/assets/sc-goodies/textures/item/icecream_vanilla.png differ