Added pinecones and acorns

This commit is contained in:
Sollace 2022-10-06 22:08:25 +02:00
parent d9ec01a479
commit 8f45fcf811
13 changed files with 71 additions and 6 deletions

View file

@ -69,6 +69,8 @@ public interface UItems {
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.INSECTS)));
Item MUFFIN = register("muffin", new MuffinItem(new Item.Settings().group(ItemGroup.FOOD).maxCount(32).food(FoodComponents.BREAD), 0));
Item PINECONE = register("pinecone", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.PINECONE).maxCount(3)));
Item ACORN = register("acorn", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.ACORN).maxCount(16)));
Item PEBBLES = register("pebbles", new RacePredicatedAliasedBlockItem(UBlocks.ROCKS, new Item.Settings().group(ItemGroup.MATERIALS), Race::canUseEarth));
Item ROCK = register("rock", new HeavyProjectileItem(new Item.Settings().group(ItemGroup.MATERIALS), 3));

View file

@ -104,6 +104,10 @@ public interface Toxics {
.with(Race.CHANGELING, of(Toxicity.SAFE, Toxin.LOVE_CONSUMPTION))
);
Toxic PINECONE = register("pinecone", new Toxic.Builder(of(Toxicity.SAFE, Toxin.healing(1)))
.with(Race.HUMAN, Ailment.INNERT)
);
static void bootstrap() {}
static Toxic register(String name, Toxic.Builder builder) {

View file

@ -40,7 +40,7 @@ public interface Toxin extends Affliction {
player.getHungerManager().add(-food.getHunger()/2, -food.getSaturationModifier()/2);
}).and(STRONG_NAUSEA).and(IF_NOT_PEACEFUL.then(WEAK_FOOD_POISONING.withChance(20))).and(WEAKNESS);
Toxin LOVE_CONSUMPTION = of(Text.literal("love"), (player, stack) -> {
Toxin LOVE_CONSUMPTION = of(Text.literal("Love"), (player, stack) -> {
player.heal(stack.isFood() ? stack.getItem().getFoodComponent().getHunger() : 1);
player.removeStatusEffect(StatusEffects.NAUSEA);
if (player.world.random.nextInt(10) == 0) {
@ -48,6 +48,10 @@ public interface Toxin extends Affliction {
}
});
static Toxin healing(int hearts) {
return of(Text.literal("Healing " + hearts + " Hearts"), (player, stack) -> player.heal(hearts));
}
default void appendTooltip(List<Text> tooltip) {
tooltip.add(getName());
}

View file

@ -39,6 +39,9 @@ public interface UFoodComponents {
FoodComponent LOVE_MUG = builder(4, 0.125F).snack().build();
FoodComponent LOVE_BUCKET = builder(8, 0.125F).build();
FoodComponent PINECONE = builder(0, 0.01F).snack().alwaysEdible().build();
FoodComponent ACORN = builder(1, 0.01F).snack().alwaysEdible().build();
static FoodComponent.Builder builder(int hunger, float saturation) {
return new FoodComponent.Builder()
.hunger(hunger)

View file

@ -69,6 +69,8 @@
"item.unicopia.rock": "Rock",
"item.unicopia.weird_rock": "Weird Rock",
"item.unicopia.rock_stew": "Rock Stew",
"item.unicopia.pinecone": "Pinecone",
"item.unicopia.acorn": "Acorn",
"item.unicopia.green_apple_seeds": "Granny Smith Apple Seeds",
"item.unicopia.sweet_apple_seeds": "Sweet Apple Seeds",
"item.unicopia.sour_apple_seeds": "Sour Apple Seeds",
@ -572,6 +574,8 @@
"advancements.unicopia.feed_trick_apple.description": "Feed a zap apple to a mob",
"advancements.unicopia.eat_trick_apple.title": "Crunchy",
"advancements.unicopia.eat_trick_apple.description": "Bite into a zap apple",
"advancements.unicopia.eat_pinecone.title": "Desperation",
"advancements.unicopia.eat_pinecone.description": "Eat a pinecone",
"advancements.unicopia.imported_oats.title": "As Delicious As They Are Expensive",
"advancements.unicopia.imported_oats.description": "Send of receive fancy imported oats",

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/acorn"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/pinecone"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,31 @@
{
"parent": "unicopia:unicopia/root",
"display": {
"icon": {
"item": "unicopia:pinecone"
},
"title": {
"translate": "advancements.unicopia.eat_pinecone.title"
},
"description": {
"translate": "advancements.unicopia.eat_pinecone.description"
},
"frame": "goal",
"show_toast": true,
"announce_to_chat": true,
"hidden": false
},
"criteria": {
"eat_pinecone": {
"trigger": "minecraft:consume_item",
"item": {
"items": [
{ "item": "unicopia:pinecone" }
]
}
}
},
"requirements": [
[ "eat_pinecone" ]
]
}

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"unicopia:pinecone"
]
}

View file

@ -3,7 +3,7 @@
"leaves": [ "minecraft:oak_leaves" ],
"drops": [
{ "weight": 1, "item": "unicopia:rotten_apple" },
{ "weight": 2, "item": "unicopia:green_apple" },
{ "weight": 3, "item": "minecraft:apple" }
{ "weight": 2, "item": "unicopia:acorn" },
{ "weight": 3, "item": "minecraft:stick" }
]
}

View file

@ -3,8 +3,7 @@
"leaves": [ "minecraft:spruce_leaves" ],
"wideTrunk": true,
"drops": [
{ "weight": 1, "item": "unicopia:sour_apple" },
{ "weight": 2, "item": "unicopia:green_apple" },
{ "weight": 4, "item": "unicopia:rotten_apple" }
{ "weight": 1, "item": "unicopia:pinecone" },
{ "weight": 4, "item": "unicopia:stick" }
]
}