Added mugs, cider, juice, burned juice, daffodil daisy sandwich, wheat worms, hay burgers, and hay fries
|
@ -0,0 +1,50 @@
|
|||
package com.minelittlepony.unicopia.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.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 DrinkableItem extends Item {
|
||||
public DrinkableItem(Item.Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity 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).abilities.creativeMode) {
|
||||
stack.decrement(1);
|
||||
}
|
||||
|
||||
return stack.isEmpty() ? new ItemStack(getRecipeRemainder()) : stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxUseTime(ItemStack stack) {
|
||||
return 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UseAction getUseAction(ItemStack stack) {
|
||||
return UseAction.DRINK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
|
||||
return ItemUsage.consumeHeldItem(world, user, hand);
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@ import com.minelittlepony.unicopia.item.toxin.UFoodComponents;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.Settings;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.Items;
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.FoodComponents;
|
||||
|
@ -57,6 +58,16 @@ public interface UItems {
|
|||
Item PEGASUS_FEATHER = register("pegasus_feather", new Item(new Item.Settings().group(ItemGroup.MATERIALS)));
|
||||
Item GRYPHON_FEATHER = register("gryphon_feather", new Item(new Item.Settings().group(ItemGroup.MATERIALS)));
|
||||
|
||||
Item DAFFODIL_DAISY_SANDWICH = register("daffodil_daisy_sandwich", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.DAFODIL_DAISY_SANDWICH)));
|
||||
Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().group(ItemGroup.FOOD).maxCount(1).food(UFoodComponents.HAY_BURGER)));
|
||||
Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().group(ItemGroup.FOOD).maxCount(16).food(UFoodComponents.HAY_FRIES)));
|
||||
Item WHEAT_WORMS = register("wheat_worms", new Item(new Item.Settings().group(ItemGroup.MISC).maxCount(16).food(UFoodComponents.WORMS)));
|
||||
|
||||
Item MUG = register("mug", new Item(new Settings().group(ItemGroup.MATERIALS).maxCount(16)));
|
||||
Item CIDER = register("cider", new DrinkableItem(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.CIDER).maxCount(1).recipeRemainder(MUG)));
|
||||
Item JUICE = register("juice", new DrinkableItem(new Item.Settings().group(ItemGroup.FOOD).recipeRemainder(Items.GLASS_BOTTLE).maxCount(1).food(UFoodComponents.JUICE)));
|
||||
Item BURNED_JUICE = register("burned_juice", new Item(new Item.Settings().group(ItemGroup.FOOD).recipeRemainder(Items.GLASS_BOTTLE).maxCount(16).food(UFoodComponents.BURNED_JUICE)));
|
||||
|
||||
Item GOLDEN_FEATHER = register("golden_feather", new Item(new Item.Settings().rarity(Rarity.UNCOMMON).group(ItemGroup.MATERIALS)));
|
||||
Item GOLDEN_WING = register("golden_wing", new Item(new Item.Settings().rarity(Rarity.UNCOMMON).group(ItemGroup.MATERIALS)));
|
||||
|
||||
|
@ -74,6 +85,7 @@ public interface UItems {
|
|||
if (item instanceof BlockItem) {
|
||||
((BlockItem)item).appendBlocks(Item.BLOCK_ITEMS, item);
|
||||
}
|
||||
Items.MILK_BUCKET.appendStacks(null, null);
|
||||
return Registry.register(Registry.ITEM, new Identifier("unicopia", name), item);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ public interface Toxics {
|
|||
|
||||
Toxic EDIBLE = forage("edible", SAFE, FOOD);
|
||||
Toxic RISKY = forage("risky", FAIR, FOOD);
|
||||
Toxic MODERATE = forage("moderate", MILD, FOOD);
|
||||
Toxic DANGEROUS = forage("dangerous", SEVERE, FOOD);
|
||||
Toxic NAUSEATING = forage("nauseating", SAFE, NAUSEA);
|
||||
Toxic RADIOACTIVE = forage("radioactive", SAFE, RADIOACTIVITY);
|
||||
|
|
|
@ -14,8 +14,9 @@ public interface UFoodComponents {
|
|||
FoodComponent HAY_BURGER = builder(3, 4).build();
|
||||
FoodComponent HAY_FRIES = builder(1, 5).build();
|
||||
FoodComponent SALAD = builder(4, 2).build();
|
||||
FoodComponent CIDER = builder(4, 2).alwaysEdible().build();
|
||||
FoodComponent RANDOM_FOLIAGE = builder(2, 1).build();
|
||||
FoodComponent JUICE = builder(2, 2).build();
|
||||
FoodComponent JUICE = builder(2, 2).alwaysEdible().build();
|
||||
FoodComponent BURNED_JUICE = builder(3, 1).build();
|
||||
FoodComponent WORMS = builder(1, 0).alwaysEdible().build();
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import javax.annotation.Nullable;
|
|||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
@ -28,7 +29,7 @@ abstract class MixinItem implements ToxicHolder {
|
|||
@Nullable
|
||||
private FoodComponent originalFoodComponent;
|
||||
|
||||
@Shadow
|
||||
@Shadow @Mutable
|
||||
private @Final FoodComponent foodComponent;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,6 +39,16 @@
|
|||
"item.unicopia.golden_feather": "Golden Feather",
|
||||
"item.unicopia.golden_wing": "Golden Wing",
|
||||
|
||||
"item.unicopia.mug": "Mug",
|
||||
"item.unicopia.cider": "Cider",
|
||||
"item.unicopia.juice": "Juice",
|
||||
"item.unicopia.burned_juice": "Burned Juice",
|
||||
|
||||
"item.unicopia.daffodil_daisy_sandwich": "Daffodil Daisy Sandwich",
|
||||
"item.unicopia.hay_burger": "Hay Burger",
|
||||
"item.unicopia.hay_fries": "Hay Fries",
|
||||
"item.unicopia.wheat_worms": "Wheat Worms",
|
||||
|
||||
"item.unicopia.pegasus_amulet": "Wings of Icarus",
|
||||
"item.unicopia.pegasus_amulet.lore": "Grants temporary flight to whoever wears it",
|
||||
"item.unicopia.amulet.energy": "Energy: %d / %d",
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/burned_juice"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "unicopia:item/mug",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/cider"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/daffodil_daisy_sandwich"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/hay_burger"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/hay_fries"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/juice"
|
||||
}
|
||||
}
|
28
src/main/resources/assets/unicopia/models/item/mug.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"parent": "item/handheld",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/mug"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"rotation": [ 0, -90, -55 ],
|
||||
"translation": [ 0, 4.0, 0.5 ],
|
||||
"scale": [ 0.85, 0.85, 0.85 ]
|
||||
},
|
||||
"thirdperson_lefthand": {
|
||||
"rotation": [ 0, 90, 55 ],
|
||||
"translation": [ 0, 4.0, 0.5 ],
|
||||
"scale": [ 0.85, 0.85, 0.85 ]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [ 0, -90, 25 ],
|
||||
"translation": [ 1.13, 3.2, 1.13 ],
|
||||
"scale": [ 0.68, 0.68, 0.68 ]
|
||||
},
|
||||
"firstperson_lefthand": {
|
||||
"rotation": [ 0, 90, -25 ],
|
||||
"translation": [ 1.13, 3.2, 1.13 ],
|
||||
"scale": [ 0.68, 0.68, 0.68 ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "unicopia:item/wheat_worms"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 197 B |
BIN
src/main/resources/assets/unicopia/textures/item/cider.png
Normal file
After Width: | Height: | Size: 3 KiB |
After Width: | Height: | Size: 3.2 KiB |
BIN
src/main/resources/assets/unicopia/textures/item/hay_burger.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/resources/assets/unicopia/textures/item/hay_fries.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/resources/assets/unicopia/textures/item/juice.png
Normal file
After Width: | Height: | Size: 271 B |
BIN
src/main/resources/assets/unicopia/textures/item/mug.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
src/main/resources/assets/unicopia/textures/item/wheat_worms.png
Normal file
After Width: | Height: | Size: 528 B |
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:grass"
|
||||
"minecraft:grass",
|
||||
"unicopia:cider"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:allium",
|
||||
"minecraft:white_tulip"
|
||||
"minecraft:white_tulip",
|
||||
"unicopia:burned_juice"
|
||||
]
|
||||
}
|
||||
|
|