Skip to content

Commit

Permalink
feat: add rocket cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkaf committed Mar 18, 2024
1 parent 959ec2c commit 756f5bf
Show file tree
Hide file tree
Showing 19 changed files with 307 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2024-03-13T15:13:43.4377125 Kaf's Valentine Special/Recipes
// 1.20.1 2024-03-18T09:42:50.8397074 Kaf's Valentine Special/Recipes
bc076317a1c015c0f8a04b0251c4489ea3e7438f data\kafvalentine\advancements\recipes\food\fire_cookie.json
8839a7102aead55bc35c0586436302bdc0ab6a5c data\kafvalentine\recipes\special_fire_cookie_from_infusing_fire_cookie.json
4da9f258446eb8f43829e51a9f7ecefba393c497 data\kafvalentine\recipes\golden_cookie.json
Expand All @@ -12,6 +12,7 @@ ffd570d9444fd6f2cf5a005c5de9f3b83c9523f4 data\kafvalentine\recipes\special_glow_
1bd58ae0d233e1074a4055fdfbee8a364ef7d4f8 data\kafvalentine\advancements\recipes\food\apple_cookie.json
301d0358add36606ba01ef3816e42b938b53eeed data\kafvalentine\recipes\aristea_cookie.json
d30bdfd34cf23202685d323e5a28555ff4914f1e data\kafvalentine\advancements\recipes\food\good_vision_cookie.json
5700c98c76a13858e27a299d1bd9000366312375 data\kafvalentine\recipes\special_rocket_cookie_from_infusing_rocket_cookie.json
c1cc9217ccf7676e4cbc9a449dbb8672ce34c799 data\kafvalentine\recipes\special_explosive_cookie_from_infusing_explosive_cookie.json
872378dd4d174d626a8c05b55b63aa08f92cea6f data\kafvalentine\recipes\purple_dye.json
dc56546942d667e5b8b197f13136e85f87d0c28f data\kafvalentine\advancements\recipes\misc\lovey_dovey_infuser.json
Expand All @@ -22,6 +23,8 @@ dc56546942d667e5b8b197f13136e85f87d0c28f data\kafvalentine\advancements\recipes\
2fbd192031dede9a8795213990b871149907828e data\kafvalentine\recipes\caramel_cookie.json
4dde57908590814abd8415477119dd1c0bbdbf00 data\kafvalentine\recipes\fire_cookie.json
14dc3c0d162bb7ec88fc947b3c78761459d91f8e data\kafvalentine\recipes\explosive_cookie.json
8aa3f863598d57c1d3ded5059a42c23b9ec66aea data\kafvalentine\recipes\rocket_cookie.json
4c40aa7f106a2d1171378bb7f87626452779d8ce data\kafvalentine\advancements\recipes\food\rocket_cookie.json
223bda39c3de43e8ed2c65305e70fb0724c7262c data\kafvalentine\recipes\special_evil_cookie_from_infusing_evil_cookie.json
1a76c63c74131ef0489b53a328827746de1efa0b data\kafvalentine\recipes\apple_cookie.json
3309422cb37087bd272230ea7232f553505b81c7 data\kafvalentine\advancements\recipes\food\nether_wart_cookie.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2024-03-13T15:13:43.4387166 Kaf's Valentine Special/Tags for minecraft:block
// 1.20.1 2024-03-18T09:42:50.8407075 Kaf's Valentine Special/Tags for minecraft:block
9c8348c58e3e27b69a4b16f8e20d8eaa980834bc data\minecraft\tags\blocks\flowers.json
8f07b04159f7352d1b38cb3fe7f1a64493c8ce5d data\minecraft\tags\blocks\bee_growables.json
9c8348c58e3e27b69a4b16f8e20d8eaa980834bc data\c\tags\blocks\flowers.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2024-03-13T15:13:43.4372053 Kaf's Valentine Special/Block Loot Tables
// 1.20.1 2024-03-18T09:42:50.8397074 Kaf's Valentine Special/Block Loot Tables
c398222fb15587d243e94a83eda77222d434bcfe data\kafvalentine\loot_tables\blocks\cotton_candy_crop.json
1be6bea11684ce2e5253abed1df40340cac97293 data\kafvalentine\loot_tables\blocks\aristea.json
df7afe04fb92f9685a24bc3d7893986bb782e56d data\kafvalentine\loot_tables\blocks\lovey_dovey_infuser.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// 1.20.1 2024-03-13T15:13:43.4346975 Kaf's Valentine Special/Model Definitions
// 1.20.1 2024-03-18T09:42:50.8372068 Kaf's Valentine Special/Model Definitions
ecfc6a0d8264149c4ed5d1dc2e09ded6805ef94a assets\kafvalentine\models\item\special_aristea_cookie.json
ce36fcf7318243a60feebd83eeeb0cac6eb4427e assets\kafvalentine\models\item\aristea_cookie.json
94fb8c93e565e2b657e2642783928b7d4368bac8 assets\kafvalentine\models\item\special_evil_cookie.json
f230362b425023b92f497863011b67a43a19d936 assets\kafvalentine\blockstates\lovey_dovey_infuser.json
988a193d6a639cfc12e2b08d43d03fea2227cb32 assets\kafvalentine\models\item\rocket_cookie.json
d649fbc5d6042bb5c33ebb9b627cb4740aa6972d assets\kafvalentine\models\item\special_fire_cookie.json
414797217c160d5fd2cc0732c4ef39bd5bf5c6d6 assets\kafvalentine\models\item\special_nether_wart_cookie.json
6487da39ba37df24e855d370b0d1169bcb496c58 assets\kafvalentine\models\item\fire_cookie.json
Expand All @@ -12,6 +13,7 @@ bd02a523edc976c062d3c21025778579d94eed1a assets\kafvalentine\blockstates\aristea
133515bd8b713a6800512752a54d62d5eb324a14 assets\kafvalentine\models\block\cotton_candy_crop_stage4.json
213ea4688849d02cc97310ca149822f7c74255de assets\kafvalentine\models\block\cotton_candy_crop_stage1.json
4ad8c13e78f60131fde29ee9da8153c623fad124 assets\kafvalentine\models\item\glow_cookie.json
c65d06030a8d294e42ce8e12c9fc194e3ad5ee43 assets\kafvalentine\models\item\special_rocket_cookie.json
f1b9765d7a5df224428d8a4908696343dc153a2a assets\kafvalentine\models\block\potted_aristea.json
5fa629abd31587b3a3ad436c953401ea28218210 assets\kafvalentine\models\item\special_good_vision_cookie.json
9e8d717f49da5b3802411bad8724b3b24ec97ea3 assets\kafvalentine\models\item\aristea.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// 1.20.1 2024-03-13T15:13:43.4392171 Kaf's Valentine Special/Tags for minecraft:item
// 1.20.1 2024-03-18T09:42:50.8412071 Kaf's Valentine Special/Tags for minecraft:item
9c8348c58e3e27b69a4b16f8e20d8eaa980834bc data\c\tags\items\flowers.json
2579c917ce22d63fca7c240c559e56d3061e91cb data\c\tags\items\cookies.json
200eacc5fa89f4704e6424d83c1731d240cf3137 data\c\tags\items\cookies.json
9821ba29b28cd7ed1bbbb41aaf307e3c57b56e99 data\c\tags\items\golden_apples.json
2388a7d48daef4a569c89aab474c716a355c724d data\c\tags\items\seeds.json
2388a7d48daef4a569c89aab474c716a355c724d data\minecraft\tags\items\villager_plantable_seeds.json
9c8348c58e3e27b69a4b16f8e20d8eaa980834bc data\c\tags\items\aristeas.json
2388a7d48daef4a569c89aab474c716a355c724d data\botania\tags\items\seed_apothecary_reagent.json
2579c917ce22d63fca7c240c559e56d3061e91cb data\origins\tags\items\ignore_diet.json
2579c917ce22d63fca7c240c559e56d3061e91cb data\kafvalentine\tags\items\kaf_cookie.json
200eacc5fa89f4704e6424d83c1731d240cf3137 data\origins\tags\items\ignore_diet.json
2388a7d48daef4a569c89aab474c716a355c724d data\naturalist\tags\items\bird_food_items.json
200eacc5fa89f4704e6424d83c1731d240cf3137 data\kafvalentine\tags\items\kaf_cookie.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// 1.20.1 2024-03-13T15:13:43.4361997 Kaf's Valentine Special/World Gen
// 1.20.1 2024-03-18T09:42:50.839207 Kaf's Valentine Special/World Gen
312eff65da6bcfab1829dcdc1e868b55ac396187 data\kafvalentine\worldgen\configured_feature\aristea.json
30a27f2e3d0058747f9ebd18abe2b3e32b5a8d98 data\kafvalentine\worldgen\placed_feature\aristea_placed.json
24 changes: 23 additions & 1 deletion src/main/generated/data/c/tags/items/cookies.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@
"kafvalentine:medic_cookie",
"kafvalentine:special_medic_cookie",
"kafvalentine:good_vision_cookie",
"kafvalentine:special_good_vision_cookie"
"kafvalentine:special_good_vision_cookie",
"kafvalentine:fire_cookie",
"kafvalentine:special_fire_cookie",
"kafvalentine:melon_cookie",
"kafvalentine:special_melon_cookie",
"kafvalentine:apple_cookie",
"kafvalentine:special_apple_cookie",
"kafvalentine:nether_wart_cookie",
"kafvalentine:special_nether_wart_cookie",
"kafvalentine:glow_cookie",
"kafvalentine:special_glow_cookie",
"kafvalentine:caramel_cookie",
"kafvalentine:special_caramel_cookie",
"kafvalentine:explosive_cookie",
"kafvalentine:special_explosive_cookie",
"kafvalentine:golden_cookie",
"kafvalentine:special_golden_cookie",
"kafvalentine:evil_cookie",
"kafvalentine:special_evil_cookie",
"kafvalentine:aristea_cookie",
"kafvalentine:special_aristea_cookie",
"kafvalentine:rocket_cookie",
"kafvalentine:special_rocket_cookie"
]
}
24 changes: 23 additions & 1 deletion src/main/generated/data/kafvalentine/tags/items/kaf_cookie.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@
"kafvalentine:medic_cookie",
"kafvalentine:special_medic_cookie",
"kafvalentine:good_vision_cookie",
"kafvalentine:special_good_vision_cookie"
"kafvalentine:special_good_vision_cookie",
"kafvalentine:fire_cookie",
"kafvalentine:special_fire_cookie",
"kafvalentine:melon_cookie",
"kafvalentine:special_melon_cookie",
"kafvalentine:apple_cookie",
"kafvalentine:special_apple_cookie",
"kafvalentine:nether_wart_cookie",
"kafvalentine:special_nether_wart_cookie",
"kafvalentine:glow_cookie",
"kafvalentine:special_glow_cookie",
"kafvalentine:caramel_cookie",
"kafvalentine:special_caramel_cookie",
"kafvalentine:explosive_cookie",
"kafvalentine:special_explosive_cookie",
"kafvalentine:golden_cookie",
"kafvalentine:special_golden_cookie",
"kafvalentine:evil_cookie",
"kafvalentine:special_evil_cookie",
"kafvalentine:aristea_cookie",
"kafvalentine:special_aristea_cookie",
"kafvalentine:rocket_cookie",
"kafvalentine:special_rocket_cookie"
]
}
24 changes: 23 additions & 1 deletion src/main/generated/data/origins/tags/items/ignore_diet.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@
"kafvalentine:medic_cookie",
"kafvalentine:special_medic_cookie",
"kafvalentine:good_vision_cookie",
"kafvalentine:special_good_vision_cookie"
"kafvalentine:special_good_vision_cookie",
"kafvalentine:fire_cookie",
"kafvalentine:special_fire_cookie",
"kafvalentine:melon_cookie",
"kafvalentine:special_melon_cookie",
"kafvalentine:apple_cookie",
"kafvalentine:special_apple_cookie",
"kafvalentine:nether_wart_cookie",
"kafvalentine:special_nether_wart_cookie",
"kafvalentine:glow_cookie",
"kafvalentine:special_glow_cookie",
"kafvalentine:caramel_cookie",
"kafvalentine:special_caramel_cookie",
"kafvalentine:explosive_cookie",
"kafvalentine:special_explosive_cookie",
"kafvalentine:golden_cookie",
"kafvalentine:special_golden_cookie",
"kafvalentine:evil_cookie",
"kafvalentine:special_evil_cookie",
"kafvalentine:aristea_cookie",
"kafvalentine:special_aristea_cookie",
"kafvalentine:rocket_cookie",
"kafvalentine:special_rocket_cookie"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,29 @@ protected void configure(RegistryWrapper.WrapperLookup arg) {
ModItems.MEDIC_COOKIE,
ModItems.SPECIAL_MEDIC_COOKIE,
ModItems.GOOD_VISION_COOKIE,
ModItems.SPECIAL_GOOD_VISION_COOKIE
ModItems.SPECIAL_GOOD_VISION_COOKIE,
ModItems.FIRE_COOKIE,
ModItems.SPECIAL_FIRE_COOKIE,
ModItems.MELON_COOKIE,
ModItems.SPECIAL_MELON_COOKIE,
ModItems.APPLE_COOKIE,
ModItems.SPECIAL_APPLE_COOKIE,
ModItems.NETHER_WART_COOKIE,
ModItems.SPECIAL_NETHER_WART_COOKIE,
ModItems.GLOW_COOKIE,
ModItems.SPECIAL_GLOW_COOKIE,
ModItems.CARAMEL_COOKIE,
ModItems.SPECIAL_CARAMEL_COOKIE,
ModItems.EXPLOSIVE_COOKIE,
ModItems.SPECIAL_EXPLOSIVE_COOKIE,
ModItems.GOLDEN_COOKIE,
ModItems.SPECIAL_GOLDEN_COOKIE,
ModItems.EVIL_COOKIE,
ModItems.SPECIAL_EVIL_COOKIE,
ModItems.ARISTEA_COOKIE,
ModItems.SPECIAL_ARISTEA_COOKIE,
ModItems.ROCKET_COOKIE,
ModItems.SPECIAL_ROCKET_COOKIE
);

var cookieBuilder = getOrCreateTagBuilder(ModTags.Items.COOKIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public void generateItemModels(ItemModelGenerator itemModelGenerator) {
itemModelGenerator.register(ModItems.SPECIAL_EVIL_COOKIE, Models.GENERATED);
itemModelGenerator.register(ModItems.ARISTEA_COOKIE, Models.GENERATED);
itemModelGenerator.register(ModItems.SPECIAL_ARISTEA_COOKIE, Models.GENERATED);
itemModelGenerator.register(ModItems.ROCKET_COOKIE, Models.GENERATED);
itemModelGenerator.register(ModItems.SPECIAL_ROCKET_COOKIE, Models.GENERATED);

itemModelGenerator.register(ModItems.COTTON_CANDY, Models.GENERATED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,20 @@ public void generate(Consumer<RecipeJsonProvider> exporter) {
conditionsFromItem(ModItems.COTTON_CANDY)
)
.offerTo(exporter, new Identifier(getRecipeName(ModItems.ARISTEA_COOKIE)));
ShapedRecipeJsonBuilder
.create(RecipeCategory.FOOD, ModItems.ROCKET_COOKIE, 2)
.pattern("ABA")
.pattern("BCB")
.pattern("ABA")
.input('A', Items.FIREWORK_ROCKET)
.input('B', ModItems.COTTON_CANDY)
.input('C', Items.COOKIE)
.criterion(hasItem(Items.FIREWORK_ROCKET), conditionsFromItem(Items.FIREWORK_ROCKET))
.criterion(hasItem(Items.COOKIE), conditionsFromItem(Items.COOKIE))
.criterion(hasItem(ModItems.COTTON_CANDY),
conditionsFromItem(ModItems.COTTON_CANDY)
)
.offerTo(exporter, new Identifier(getRecipeName(ModItems.ROCKET_COOKIE)));

LoveyDoveyInfusingRecipeJsonBuilder
.create()
Expand Down Expand Up @@ -298,5 +312,10 @@ public void generate(Consumer<RecipeJsonProvider> exporter) {
.input(ModItems.ARISTEA_COOKIE)
.output(ModItems.SPECIAL_ARISTEA_COOKIE)
.offerTo(exporter);
LoveyDoveyInfusingRecipeJsonBuilder
.create()
.input(ModItems.ROCKET_COOKIE)
.output(ModItems.SPECIAL_ROCKET_COOKIE)
.offerTo(exporter);
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/codekaffe/valentine/item/ModItemGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class ModItemGroups {
entries.add(ModItems.SPECIAL_EVIL_COOKIE);
entries.add(ModItems.ARISTEA_COOKIE);
entries.add(ModItems.SPECIAL_ARISTEA_COOKIE);
entries.add(ModItems.ROCKET_COOKIE);
entries.add(ModItems.SPECIAL_ROCKET_COOKIE);
entries.add(ModItems.COTTON_CANDY);
entries.add(ModItems.COTTON_CANDY_SEEDS);
entries.add(ModBlocks.ARISTEA);
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/codekaffe/valentine/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ public class ModItems {
new SpecialAristeaCookie(new FabricItemSettings().food(SpecialAristeaCookie.FOOD_COMPONENT))
);

public static final Item ROCKET_COOKIE = registerItem(
"rocket_cookie",
new RocketCookie(new FabricItemSettings().food(RocketCookie.FOOD_COMPONENT))
);
public static final Item SPECIAL_ROCKET_COOKIE = registerItem(
"special_rocket_cookie",
new SpecialRocketCookie(new FabricItemSettings().food(SpecialRocketCookie.FOOD_COMPONENT))
);

public static final Item COTTON_CANDY = registerItem(
"cotton_candy",
new Item(new FabricItemSettings().food(ModFoodComponents.COTTON_CANDY))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package com.codekaffe.valentine.item.custom;

import com.google.common.collect.Lists;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.FireworkRocketEntity;
import net.minecraft.item.*;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList;
import net.minecraft.text.Text;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Formatting;
import net.minecraft.util.Util;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;

public class RocketCookie extends Item {

public static final FoodComponent FOOD_COMPONENT = new FoodComponent.Builder()
.hunger(1)
.saturationModifier(0.1f)
.alwaysEdible()
.snack()
.build();

public RocketCookie(Settings settings) {
super(settings);
}

@Override
public void appendTooltip(
ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context
) {
tooltip.add(Text
.literal("Do you want to watch the fireworks together?")
.formatted(Formatting.GOLD));
}

@Override
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) {
if (!world.isClient()) {
Random random = user.getRandom();
DyeColor dyeColor = Util.getRandom(DyeColor.values(), random);
ItemStack itemStack = this.createFirework(dyeColor, 0);
FireworkRocketEntity fireworkRocketEntity = new FireworkRocketEntity(world,
user,
user.getX(),
user.getEyeY(),
user.getZ(),
itemStack
);
world.spawnEntity(fireworkRocketEntity);
}
return super.finishUsing(stack, world, user);
}

private ItemStack createFirework(DyeColor color, int flight) {
ItemStack itemStack = new ItemStack(Items.FIREWORK_ROCKET, 1);
ItemStack itemStack2 = new ItemStack(Items.FIREWORK_STAR);
NbtCompound nbtCompound = itemStack2.getOrCreateSubNbt("Explosion");
ArrayList<Integer> list = Lists.newArrayList();
list.add(color.getFireworkColor());
nbtCompound.putIntArray("Colors", list);
nbtCompound.putByte("Type", (byte) FireworkRocketItem.Type.SMALL_BALL.getId());
NbtCompound nbtCompound2 = itemStack.getOrCreateSubNbt("Fireworks");
NbtList nbtList = new NbtList();
NbtCompound nbtCompound3 = itemStack2.getSubNbt("Explosion");
if (nbtCompound3 != null) {
nbtList.add(nbtCompound3);
}
nbtCompound2.putByte("Flight", (byte) flight);
if (!nbtList.isEmpty()) {
nbtCompound2.put("Explosions", nbtList);
}
return itemStack;
}
}
Loading

0 comments on commit 756f5bf

Please sign in to comment.