-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
307 additions
and
14 deletions.
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/a0c9365c657f509503fac80b53d576b510533fee
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
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/bd908bddfabee7737f5b730e2e8341ed2e92df63
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
8 changes: 4 additions & 4 deletions
8
src/main/generated/.cache/cb69bf5fbb1a5dd09f0eb40be4f576f70575a6eb
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 |
---|---|---|
@@ -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 |
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/fabb740fca7beb5b126bb4f5ff425b6053e9c8d8
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 |
---|---|---|
@@ -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 |
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
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
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
81 changes: 81 additions & 0 deletions
81
src/main/java/com/codekaffe/valentine/item/custom/RocketCookie.java
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,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; | ||
} | ||
} |
Oops, something went wrong.