generated from FabricMC/fabric-example-mod
-
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
51 changed files
with
243 additions
and
7 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
55 changes: 55 additions & 0 deletions
55
src/main/java/net/candy/chocolatevanilla/item/ChocolateMilkBucketItem.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,55 @@ | ||
package net.candy.chocolatevanilla.item; | ||
|
||
import net.minecraft.advancement.criterion.Criteria; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.ItemUsage; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.stat.Stats; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.TypedActionResult; | ||
import net.minecraft.util.UseAction; | ||
import net.minecraft.world.World; | ||
|
||
public class ChocolateMilkBucketItem extends Item { | ||
private static final int MAX_USE_TIME = 32; | ||
|
||
public ChocolateMilkBucketItem(Item.Settings settings) { | ||
super(settings); | ||
} | ||
|
||
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { | ||
super.finishUsing(stack, world, user); | ||
if (user instanceof ServerPlayerEntity) { | ||
ServerPlayerEntity serverPlayerEntity = (ServerPlayerEntity)user; | ||
Criteria.CONSUME_ITEM.trigger(serverPlayerEntity, stack); | ||
serverPlayerEntity.incrementStat(Stats.USED.getOrCreateStat(this)); | ||
} | ||
|
||
if (user instanceof PlayerEntity && !((PlayerEntity)user).getAbilities().creativeMode) { | ||
stack.decrement(1); | ||
} | ||
|
||
if (!world.isClient) { | ||
user.clearStatusEffects(); | ||
} | ||
|
||
return stack; | ||
} | ||
|
||
public int getMaxUseTime(ItemStack stack) { | ||
return 32; | ||
} | ||
|
||
public UseAction getUseAction(ItemStack stack) { | ||
return UseAction.DRINK; | ||
} | ||
|
||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) { | ||
return ItemUsage.consumeHeldItem(world, user, hand); | ||
} | ||
} | ||
|
68 changes: 68 additions & 0 deletions
68
src/main/java/net/candy/chocolatevanilla/item/DragonSpiritItem.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,68 @@ | ||
package net.candy.chocolatevanilla.item; | ||
|
||
import net.minecraft.advancement.criterion.Criteria; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.ItemUsage; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.sound.SoundEvent; | ||
import net.minecraft.sound.SoundEvents; | ||
import net.minecraft.stat.Stats; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.TypedActionResult; | ||
import net.minecraft.util.UseAction; | ||
import net.minecraft.world.World; | ||
|
||
public class DragonSpiritItem extends Item { | ||
private static final int MAX_USE_TIME = 25; | ||
|
||
public DragonSpiritItem(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { | ||
super.finishUsing(stack, world, user); | ||
if (user instanceof ServerPlayerEntity) { | ||
ServerPlayerEntity serverPlayerEntity = (ServerPlayerEntity)user; | ||
Criteria.CONSUME_ITEM.trigger(serverPlayerEntity, stack); | ||
serverPlayerEntity.incrementStat(Stats.USED.getOrCreateStat(this)); | ||
} | ||
|
||
if (stack.isEmpty()) { | ||
return new ItemStack(Items.GLASS_BOTTLE); | ||
} else { | ||
if (user instanceof PlayerEntity && !((PlayerEntity)user).getAbilities().creativeMode) { | ||
ItemStack itemStack = new ItemStack(Items.GLASS_BOTTLE); | ||
PlayerEntity playerEntity = (PlayerEntity)user; | ||
if (!playerEntity.getInventory().insertStack(itemStack)) { | ||
playerEntity.dropItem(itemStack, false); | ||
} | ||
} | ||
|
||
return stack; | ||
} | ||
} | ||
|
||
public int getMaxUseTime(ItemStack stack) { | ||
return 40; | ||
} | ||
|
||
public UseAction getUseAction(ItemStack stack) { | ||
return UseAction.DRINK; | ||
} | ||
|
||
public SoundEvent getDrinkSound() { | ||
return SoundEvents.ITEM_HONEY_BOTTLE_DRINK; | ||
} | ||
|
||
public SoundEvent getEatSound() { | ||
return SoundEvents.ITEM_HONEY_BOTTLE_DRINK; | ||
} | ||
|
||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) { | ||
return ItemUsage.consumeHeldItem(world, user, hand); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
src/main/java/net/candy/chocolatevanilla/item/EnchanteaItem.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,74 @@ | ||
package net.candy.chocolatevanilla.item; | ||
|
||
import net.minecraft.advancement.criterion.Criteria; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.effect.StatusEffects; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.ItemUsage; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.sound.SoundEvent; | ||
import net.minecraft.sound.SoundEvents; | ||
import net.minecraft.stat.Stats; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.TypedActionResult; | ||
import net.minecraft.util.UseAction; | ||
import net.minecraft.world.World; | ||
|
||
public class EnchanteaItem extends Item { | ||
private static final int MAX_USE_TIME = 25; | ||
|
||
public boolean hasGlint(ItemStack stack) { | ||
return true; | ||
} | ||
|
||
public EnchanteaItem(Item.Settings settings) { | ||
super(settings); | ||
} | ||
|
||
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { | ||
super.finishUsing(stack, world, user); | ||
if (user instanceof ServerPlayerEntity) { | ||
ServerPlayerEntity serverPlayerEntity = (ServerPlayerEntity)user; | ||
Criteria.CONSUME_ITEM.trigger(serverPlayerEntity, stack); | ||
serverPlayerEntity.incrementStat(Stats.USED.getOrCreateStat(this)); | ||
} | ||
|
||
if (stack.isEmpty()) { | ||
return new ItemStack(Items.GLASS_BOTTLE); | ||
} else { | ||
if (user instanceof PlayerEntity && !((PlayerEntity)user).getAbilities().creativeMode) { | ||
ItemStack itemStack = new ItemStack(Items.GLASS_BOTTLE); | ||
PlayerEntity playerEntity = (PlayerEntity)user; | ||
if (!playerEntity.getInventory().insertStack(itemStack)) { | ||
playerEntity.dropItem(itemStack, false); | ||
} | ||
} | ||
|
||
return stack; | ||
} | ||
} | ||
|
||
public int getMaxUseTime(ItemStack stack) { | ||
return 40; | ||
} | ||
|
||
public UseAction getUseAction(ItemStack stack) { | ||
return UseAction.DRINK; | ||
} | ||
|
||
public SoundEvent getDrinkSound() { | ||
return SoundEvents.ITEM_HONEY_BOTTLE_DRINK; | ||
} | ||
|
||
public SoundEvent getEatSound() { | ||
return SoundEvents.ITEM_HONEY_BOTTLE_DRINK; | ||
} | ||
|
||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) { | ||
return ItemUsage.consumeHeldItem(world, user, hand); | ||
} | ||
} | ||
|
35 changes: 35 additions & 0 deletions
35
src/main/resources/assets/chocolate_vanilla/lang/en_us.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"item.chocolate_vanilla.sweet_berry_pie": "Sweet Berry Pie", | ||
"item.chocolate_vanilla.apple_pie": "Apple Pie", | ||
"item.chocolate_vanilla.glow_berry_pie": "Glow Berry Pie", | ||
"item.chocolate_vanilla.carrot_cake": "Carrot Cake", | ||
"item.chocolate_vanilla.beetroot_seed_cake": "Beetroot Seed Cake", | ||
"item.chocolate_vanilla.beef_stroganoff": "Beef Stroganoff", | ||
"item.chocolate_vanilla.jam_sandwich": "Jam Sandwich", | ||
"item.chocolate_vanilla.honey_sandwich": "Honey Sandwich", | ||
"item.chocolate_vanilla.chocolate_milk": "Chocolate Milk", | ||
"item.chocolate_vanilla.hot_chocolate": "Hot Chocolate", | ||
"item.chocolate_vanilla.chocolate_icecream_bucket": "Bucket of Chocolate Icecream", | ||
"item.chocolate_vanilla.grilled_beetroot": "Grilled Beetroot", | ||
"item.chocolate_vanilla.braised_bamboo": "Braised Bamboo", | ||
"item.chocolate_vanilla.roasted_pumpkin_seeds": "Roasted Pumpkin Seeds", | ||
"item.chocolate_vanilla.roasted_melon_seeds": "Roasted Melon Seeds", | ||
"item.chocolate_vanilla.squid_ink_pasta": "Squid Ink Pasta", | ||
"item.chocolate_vanilla.glow_squid_ink_pasta": "Glow Squid Ink Pasta", | ||
"item.chocolate_vanilla.chicken_sandwich": "Chicken Sandwich", | ||
"item.chocolate_vanilla.fish_sandwich": "Fish Sandwich", | ||
"item.chocolate_vanilla.sushi": "Sushi", | ||
"item.chocolate_vanilla.watermelon_juice": "Melon Juice", | ||
"item.chocolate_vanilla.chorus_juice": "Chorus Fruit Juice", | ||
"item.chocolate_vanilla.enchantea": "Enchantea", | ||
"item.chocolate_vanilla.rose_tea": "Rose Tea", | ||
"item.chocolate_vanilla.wither_rose_tea": "Wither Rose Tea", | ||
"item.chocolate_vanilla.candied_petals": "Candied Tulip Petals", | ||
"item.chocolate_vanilla.pufferfish_stew": "Pufferfish Stew", | ||
"item.chocolate_vanilla.fried_egg": "Fried Egg", | ||
"item.chocolate_vanilla.scalding_stew": "Scalding Stew", | ||
"item.chocolate_vanilla.spiked_berry_tea": "Spiked Berry Tea", | ||
"item.chocolate_vanilla.dragon_spirit": "Dragon's Spirit", | ||
"item.chocolate_vanilla.fried_membrane": "Chicharones", | ||
"item.chocolate_vanilla.jellied_ender_eye": "Jellied Eye of Ender" | ||
} |
Binary file modified
BIN
+4 Bytes
(100%)
src/main/resources/assets/chocolate_vanilla/textures/item/pufferfish_stew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.