This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added ice cream --------- Co-authored-by: Drew Edwards <github@drew.contact>
- Loading branch information
1 parent
f24d995
commit ced16e3
Showing
18 changed files
with
206 additions
and
7 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/2ac56fe60cdf0cd798eb1c9904c9821512b5e8c3
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/8dddb602b6fc23bde80dd2fdb61e97cf507d1fd6
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/c2d4f06d6dbced8ac5764fdbef726f95d8dfcf32
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
src/main/kotlin/io/sc3/goodies/datagen/recipes/handlers/IceCreamRecipes.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RecipeJsonProvider>) { | ||
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<RecipeJsonProvider>) { | ||
// 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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} | ||
} |
Binary file added
BIN
+399 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_beetroot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+356 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_chocolate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+441 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_melon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+387 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_neapolitan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+394 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_spruce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+401 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_sundae.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+376 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_sweetberry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+363 Bytes
src/main/resources/assets/sc-goodies/textures/item/icecream_vanilla.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.