diff --git a/src/main/java/com/minelittlepony/unicopia/entity/UTradeOffers.java b/src/main/java/com/minelittlepony/unicopia/entity/UTradeOffers.java index 1b541108..26721e32 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/UTradeOffers.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/UTradeOffers.java @@ -39,6 +39,7 @@ public interface UTradeOffers { }); TradeOfferHelper.registerVillagerOffers(VillagerProfession.FARMER, 2, factories -> { factories.add(buy(Items.EMERALD, 4, UTags.APPLE_SEEDS, 2, 20, 1, 0.05F)); + factories.add(buy(Items.EMERALD, 8, UItems.MANGO, 1, 15, 1, 0.025F)); }); TradeOfferHelper.registerWanderingTraderOffers(1, factories -> { @@ -50,6 +51,7 @@ public interface UTradeOffers { factories.add(buy(UItems.ZAP_APPLE, 45, UItems.ZAP_APPLE_JAM_JAR, 5, 50, 3, 0.07F)); factories.add(buy(UItems.CIDER, 1, UItems.FRIENDSHIP_BRACELET, 1, 6, 1, 0.05F)); factories.add(buy(UItems.GEMSTONE, 5, UTags.FRESH_APPLES, 2, 12, 3, 0.05F)); + factories.add(buy(Items.EMERALD, 4, UItems.MANGO, 1, 35, 1, 0.025F)); factories.add(new JarredItemTradeOfferFactory()); }); TradeOfferHelper.registerWanderingTraderOffers(2, factories -> { diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index ee357920..6b04956e 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -74,6 +74,7 @@ public interface UItems { Item MUFFIN = register("muffin", new MuffinItem(new Item.Settings().maxCount(32).food(FoodComponents.BREAD), 0), ItemGroups.FOOD_AND_DRINK); Item PINECONE = register("pinecone", new Item(new Item.Settings().food(UFoodComponents.PINECONE).maxCount(3)), ItemGroups.FOOD_AND_DRINK); Item ACORN = register("acorn", new Item(new Item.Settings().food(UFoodComponents.ACORN).maxCount(16)), ItemGroups.FOOD_AND_DRINK); + Item MANGO = register("mango", new Item(new Item.Settings().food(UFoodComponents.MANGO)), ItemGroups.FOOD_AND_DRINK); Item PEBBLES = register("pebbles", new RacePredicatedAliasedBlockItem(UBlocks.ROCKS, new Item.Settings(), Race::canUseEarth), ItemGroups.NATURAL); Item ROCK = register("rock", new HeavyProjectileItem(new Item.Settings(), 3), ItemGroups.NATURAL); diff --git a/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxics.java b/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxics.java index 144aa925..64486cd6 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxics.java +++ b/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxics.java @@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.item.toxin; import com.minelittlepony.unicopia.*; import com.minelittlepony.unicopia.util.RegistryUtils; +import net.minecraft.entity.effect.StatusEffects; import net.minecraft.registry.Registry; import static com.minelittlepony.unicopia.item.toxin.Toxicity.*; @@ -112,6 +113,15 @@ public interface Toxics { .with(Race.HUMAN, Ailment.INNERT) ); + Toxic BAT_PONYS_DELIGHT = register("bat_ponys_delight", new Toxic.Builder(Ailment.INNERT) + .with(Race.BAT, Ailment.of(Toxicity.SAFE, + Toxin.of(StatusEffects.HEALTH_BOOST, 30, 2) + .and(Toxin.of(StatusEffects.JUMP_BOOST, 30, 1)) + .and(Toxin.of(StatusEffects.SPEED, 30, 1)) + .and(Toxin.of(StatusEffects.REGENERATION, 3, 3)) + )) + ); + static void bootstrap() {} static Toxic register(String name, Toxic.Builder builder) { diff --git a/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxin.java b/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxin.java index d9de87c1..d5ecaeda 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxin.java +++ b/src/main/java/com/minelittlepony/unicopia/item/toxin/Toxin.java @@ -4,6 +4,7 @@ import java.util.List; import com.minelittlepony.unicopia.entity.effect.UEffects; +import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; @@ -13,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.StringHelper; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.Difficulty; public interface Toxin extends Affliction { @@ -111,11 +113,16 @@ public interface Toxin extends Affliction { return of(text, (player, stack) -> { StatusEffectInstance current = player.getStatusEffect(effect); + float health = player.getHealth(); if (current != null) { player.addStatusEffect(new StatusEffectInstance(effect, ticks + current.getDuration(), amplifier + current.getAmplifier(), false, false, false)); } else { player.addStatusEffect(new StatusEffectInstance(effect, ticks, amplifier, false, false, false)); } + // keep original health + if (effect.getAttributeModifiers().containsKey(EntityAttributes.GENERIC_MAX_HEALTH)) { + player.setHealth(MathHelper.clamp(health, 0, player.getMaxHealth())); + } }); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java b/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java index 3200ee2e..8e7d56d7 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java +++ b/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java @@ -41,6 +41,7 @@ public interface UFoodComponents { FoodComponent PINECONE = builder(0, 0.01F).snack().alwaysEdible().build(); FoodComponent ACORN = builder(1, 0.01F).snack().alwaysEdible().build(); + FoodComponent MANGO = builder(8, 0.8F).alwaysEdible().build(); static FoodComponent.Builder builder(int hunger, float saturation) { return new FoodComponent.Builder() diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index c422727e..b837e5f6 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -73,6 +73,7 @@ "item.unicopia.juice": "Juice", "item.unicopia.burned_juice": "Burned Juice", + "item.unicopia.mango": "Mango", "item.unicopia.sunglasses": "Sunglasses", "item.unicopia.broken_sunglasses": "Broken Sunglasses", diff --git a/src/main/resources/assets/unicopia/models/item/mango.json b/src/main/resources/assets/unicopia/models/item/mango.json new file mode 100644 index 00000000..eba4d587 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/mango.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/mango" + } +} diff --git a/src/main/resources/assets/unicopia/textures/item/mango.png b/src/main/resources/assets/unicopia/textures/item/mango.png new file mode 100644 index 00000000..6bb416ea Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/mango.png differ diff --git a/src/main/resources/data/c/tags/items/fruit.json b/src/main/resources/data/c/tags/items/fruit.json new file mode 100644 index 00000000..2f6d5efe --- /dev/null +++ b/src/main/resources/data/c/tags/items/fruit.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "unicopia:mango" + ] +} diff --git a/src/main/resources/data/c/tags/items/fruits.json b/src/main/resources/data/c/tags/items/fruits.json new file mode 100644 index 00000000..2f6d5efe --- /dev/null +++ b/src/main/resources/data/c/tags/items/fruits.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "unicopia:mango" + ] +} diff --git a/src/main/resources/data/c/tags/items/mangoes.json b/src/main/resources/data/c/tags/items/mangoes.json new file mode 100644 index 00000000..2f6d5efe --- /dev/null +++ b/src/main/resources/data/c/tags/items/mangoes.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "unicopia:mango" + ] +} diff --git a/src/main/resources/data/unicopia/tags/items/food_types/bat_ponys_delight.json b/src/main/resources/data/unicopia/tags/items/food_types/bat_ponys_delight.json new file mode 100644 index 00000000..8309c0f0 --- /dev/null +++ b/src/main/resources/data/unicopia/tags/items/food_types/bat_ponys_delight.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "unicopia:mango", + { "id": "#c:mango", "required": false }, + { "id": "#c:mangoes", "required": false } + ] +} diff --git a/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json b/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json index 5bbf16f4..9055f23e 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json +++ b/src/main/resources/data/unicopia/tags/items/groups/bat_pony.json @@ -3,6 +3,7 @@ "values": [ "#unicopia:food_types/raw_insect", "#unicopia:polearms", + "unicopia:mango", "unicopia:sunglasses", "unicopia:broken_sunglasses" ] diff --git a/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json b/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json index 82a2d37f..5f8d8fc8 100644 --- a/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json +++ b/src/main/resources/data/unicopia/tags/items/groups/earth_pony.json @@ -19,6 +19,7 @@ "unicopia:green_apple_seeds", "unicopia:sweet_apple_seeds", "unicopia:sour_apple_seeds", + "unicopia:mango", "unicopia:empty_jar", "unicopia:cooked_zap_apple", "unicopia:zap_apple_jam_jar", @@ -31,6 +32,7 @@ "unicopia:hay_fries", "unicopia:wheat_worms", "unicopia:muffin", + "unicopia:crystal_shard", "unicopia:pebbles", "unicopia:rock", "unicopia:weird_rock", diff --git a/src/main/resources/data/unicopia/traits/organic_plant_derived.json b/src/main/resources/data/unicopia/traits/organic_plant_derived.json index dc650d27..c2167d62 100644 --- a/src/main/resources/data/unicopia/traits/organic_plant_derived.json +++ b/src/main/resources/data/unicopia/traits/organic_plant_derived.json @@ -4,6 +4,7 @@ "items": [ "unicopia:green_apple_leaves", "unicopia:sweet_apple_leaves", - "unicopia:sour_apple_leaves" + "unicopia:sour_apple_leaves", + "unicopia:mango" ] } \ No newline at end of file