mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-24 21:54:33 +01:00
Datagen food groups+
- add more variety in the foraging groups - rebalance the probability of negative effects/food poisoning when eating the foraged things - add groups for rotten insect - moved fermented spider eye to the rotten insect category - removed unused foraging_moderate category - fixed incorrect tag reference breaking sapling eating
This commit is contained in:
parent
734e75f8c8
commit
171c786dec
68 changed files with 400 additions and 722 deletions
|
@ -49,6 +49,7 @@ public interface UConventionalTags {
|
||||||
|
|
||||||
TagKey<Item> RAW_INSECT = item("raw_insect");
|
TagKey<Item> RAW_INSECT = item("raw_insect");
|
||||||
TagKey<Item> COOKED_INSECT = item("cooked_insect");
|
TagKey<Item> COOKED_INSECT = item("cooked_insect");
|
||||||
|
TagKey<Item> ROTTEN_INSECT = item("rotten_insect");
|
||||||
|
|
||||||
TagKey<Item> RAW_FISH = item("raw_fish");
|
TagKey<Item> RAW_FISH = item("raw_fish");
|
||||||
TagKey<Item> COOKED_FISH = item("cooked_fish");
|
TagKey<Item> COOKED_FISH = item("cooked_fish");
|
||||||
|
|
|
@ -30,7 +30,6 @@ public interface UTags {
|
||||||
TagKey<Item> MAGIC_FEATHERS = item("magic_feathers");
|
TagKey<Item> MAGIC_FEATHERS = item("magic_feathers");
|
||||||
|
|
||||||
TagKey<Item> SHADES = item("shades");
|
TagKey<Item> SHADES = item("shades");
|
||||||
TagKey<Item> CHANGELING_EDIBLE = item("food_types/changeling_edible");
|
|
||||||
TagKey<Item> SPOOKED_MOB_DROPS = item("spooked_mob_drops");
|
TagKey<Item> SPOOKED_MOB_DROPS = item("spooked_mob_drops");
|
||||||
TagKey<Item> HAS_NO_TRAITS = item("has_no_traits");
|
TagKey<Item> HAS_NO_TRAITS = item("has_no_traits");
|
||||||
TagKey<Item> IS_DELIVERED_AGGRESSIVELY = item("is_delivered_aggressively");
|
TagKey<Item> IS_DELIVERED_AGGRESSIVELY = item("is_delivered_aggressively");
|
||||||
|
@ -46,6 +45,9 @@ public interface UTags {
|
||||||
TagKey<Item> ROCK_STEWS = item("rock_stews");
|
TagKey<Item> ROCK_STEWS = item("rock_stews");
|
||||||
TagKey<Item> BAKED_GOODS = item("baked_goods");
|
TagKey<Item> BAKED_GOODS = item("baked_goods");
|
||||||
|
|
||||||
|
TagKey<Item> HIGH_QUALITY_SEA_VEGETABLES = item("food_types/high_quality_sea_vegetables");
|
||||||
|
TagKey<Item> LOW_QUALITY_SEA_VEGETABLES = item("food_types/low_quality_sea_vegetables");
|
||||||
|
|
||||||
TagKey<Item> POLEARMS = item("polearms");
|
TagKey<Item> POLEARMS = item("polearms");
|
||||||
TagKey<Item> HORSE_SHOES = item("horse_shoes");
|
TagKey<Item> HORSE_SHOES = item("horse_shoes");
|
||||||
TagKey<Item> APPLE_SEEDS = item("apple_seeds");
|
TagKey<Item> APPLE_SEEDS = item("apple_seeds");
|
||||||
|
@ -64,6 +66,18 @@ public interface UTags {
|
||||||
TagKey<Item> GROUP_SEA_PONY = item("groups/sea_pony");
|
TagKey<Item> GROUP_SEA_PONY = item("groups/sea_pony");
|
||||||
TagKey<Item> GROUP_CHANGELING = item("groups/changeling");
|
TagKey<Item> GROUP_CHANGELING = item("groups/changeling");
|
||||||
|
|
||||||
|
TagKey<Item> FORAGE_BLINDING = item("forage/blinding");
|
||||||
|
TagKey<Item> FORAGE_DANGEROUS = item("forage/dangerous");
|
||||||
|
TagKey<Item> FORAGE_FILLING = item("forage/filling");
|
||||||
|
TagKey<Item> FORAGE_SAFE = item("forage/safe");
|
||||||
|
TagKey<Item> FORAGE_NAUSEATING = item("forage/nauseating");
|
||||||
|
TagKey<Item> FORAGE_PRICKLY = item("forage/prickly");
|
||||||
|
TagKey<Item> FORAGE_GLOWING = item("forage/glowing");
|
||||||
|
TagKey<Item> FORAGE_RISKY = item("forage/risky");
|
||||||
|
TagKey<Item> FORAGE_STRENGHENING = item("forage/strenghtening");
|
||||||
|
TagKey<Item> FORAGE_SEVERE_NAUSEATING = item("forage/severe/nauseating");
|
||||||
|
TagKey<Item> FORAGE_SEVERE_PRICKLY = item("forage/severe/prickly");
|
||||||
|
|
||||||
private static TagKey<Item> item(String name) {
|
private static TagKey<Item> item(String name) {
|
||||||
return TagKey.of(RegistryKeys.ITEM, Unicopia.id(name));
|
return TagKey.of(RegistryKeys.ITEM, Unicopia.id(name));
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,10 @@ public class DataCollector {
|
||||||
this.resolver = resolver;
|
this.resolver = resolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDefined(Identifier id) {
|
||||||
|
return values.containsKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
public BiConsumer<Identifier, Supplier<JsonElement>> prime() {
|
public BiConsumer<Identifier, Supplier<JsonElement>> prime() {
|
||||||
values.clear();
|
values.clear();
|
||||||
return (Identifier id, Supplier<JsonElement> value) ->
|
return (Identifier id, Supplier<JsonElement> value) ->
|
||||||
|
|
|
@ -4,6 +4,7 @@ import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.block.EdibleBlock;
|
import com.minelittlepony.unicopia.block.EdibleBlock;
|
||||||
|
import com.minelittlepony.unicopia.datagen.providers.DietsProvider;
|
||||||
import com.minelittlepony.unicopia.datagen.providers.SeasonsGrowthRatesProvider;
|
import com.minelittlepony.unicopia.datagen.providers.SeasonsGrowthRatesProvider;
|
||||||
import com.minelittlepony.unicopia.datagen.providers.UAdvancementsProvider;
|
import com.minelittlepony.unicopia.datagen.providers.UAdvancementsProvider;
|
||||||
import com.minelittlepony.unicopia.datagen.providers.UModelProvider;
|
import com.minelittlepony.unicopia.datagen.providers.UModelProvider;
|
||||||
|
@ -49,7 +50,8 @@ public class Datagen implements DataGeneratorEntrypoint {
|
||||||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
||||||
final var pack = fabricDataGenerator.createPack();
|
final var pack = fabricDataGenerator.createPack();
|
||||||
final var blockTags = pack.addProvider(UBlockTagProvider::new);
|
final var blockTags = pack.addProvider(UBlockTagProvider::new);
|
||||||
pack.addProvider((output, registries) -> new UItemTagProvider(output, registries, blockTags));
|
final var itemTags = pack.addProvider((output, registries) -> new UItemTagProvider(output, registries, blockTags));
|
||||||
|
pack.addProvider((output, registries) -> new DietsProvider(output, itemTags));
|
||||||
pack.addProvider(UDamageTypeProvider::new);
|
pack.addProvider(UDamageTypeProvider::new);
|
||||||
|
|
||||||
pack.addProvider(UModelProvider::new);
|
pack.addProvider(UModelProvider::new);
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.minelittlepony.unicopia.datagen.providers;
|
||||||
|
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
import com.minelittlepony.unicopia.Race;
|
||||||
|
import com.minelittlepony.unicopia.diet.DietProfile;
|
||||||
|
|
||||||
|
public class DietProfileGenerator {
|
||||||
|
|
||||||
|
public void generate(BiConsumer<Race, DietProfile> exporter) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.minelittlepony.unicopia.datagen.providers;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.minelittlepony.unicopia.Race;
|
||||||
|
import com.minelittlepony.unicopia.datagen.DataCollector;
|
||||||
|
import com.minelittlepony.unicopia.diet.DietProfile;
|
||||||
|
import com.minelittlepony.unicopia.diet.FoodGroup;
|
||||||
|
import com.mojang.serialization.JsonOps;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.minecraft.data.DataOutput;
|
||||||
|
import net.minecraft.data.DataProvider;
|
||||||
|
import net.minecraft.data.DataWriter;
|
||||||
|
import net.minecraft.data.server.tag.TagProvider;
|
||||||
|
import net.minecraft.data.server.tag.TagProvider.TagLookup;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.registry.tag.TagKey;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class DietsProvider implements DataProvider {
|
||||||
|
private final DataCollector dietsCollector;
|
||||||
|
private final DataCollector categoriesCollector;
|
||||||
|
|
||||||
|
private final CompletableFuture<TagLookup<Item>> itemTagLookup;
|
||||||
|
|
||||||
|
public DietsProvider(FabricDataOutput output, TagProvider<Item> tagProvider) {
|
||||||
|
this.dietsCollector = new DataCollector(output.getResolver(DataOutput.OutputType.DATA_PACK, "diet/races"));
|
||||||
|
this.categoriesCollector = new DataCollector(output.getResolver(DataOutput.OutputType.DATA_PACK, "diet/food_groups"));
|
||||||
|
itemTagLookup = tagProvider.getTagLookupFuture();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "Diets";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<?> run(DataWriter writer) {
|
||||||
|
return itemTagLookup.thenCompose(tagLookup -> {
|
||||||
|
var diets = categoriesCollector.prime();
|
||||||
|
Map<Identifier, Set<Identifier>> keyToGroupId = new HashMap<>();
|
||||||
|
new FoodGroupsGenerator().generate((id, builder) -> {
|
||||||
|
var attributes = builder.build();
|
||||||
|
attributes.tags().forEach(key -> {
|
||||||
|
if (!tagLookup.contains(TagKey.of(RegistryKeys.ITEM, key.id()))) {
|
||||||
|
throw new IllegalArgumentException("Food group " + id + " references unknown item tag " + key.id());
|
||||||
|
}
|
||||||
|
keyToGroupId.computeIfAbsent(key.id(), i -> new HashSet<>()).add(id);
|
||||||
|
});
|
||||||
|
diets.accept(id, () -> FoodGroup.CODEC.encode(attributes, JsonOps.INSTANCE, new JsonObject()).result().get());
|
||||||
|
});
|
||||||
|
var profiles = dietsCollector.prime();
|
||||||
|
new DietProfileGenerator().generate((race, profile) -> {
|
||||||
|
Identifier id = Race.REGISTRY.getId(race);
|
||||||
|
StringBuilder issues = new StringBuilder();
|
||||||
|
profile.validate(issue -> {
|
||||||
|
issues.append(System.lineSeparator()).append(issue);
|
||||||
|
}, categoriesCollector::isDefined);
|
||||||
|
if (!issues.isEmpty()) {
|
||||||
|
throw new IllegalArgumentException("Diet profile " + id + " failed validation: " + issues.toString());
|
||||||
|
}
|
||||||
|
profiles.accept(id, () -> DietProfile.CODEC.encode(profile, JsonOps.INSTANCE, new JsonObject()).result().get());
|
||||||
|
});
|
||||||
|
keyToGroupId.forEach((tag, groups) -> {
|
||||||
|
if (groups.size() > 1) {
|
||||||
|
throw new IllegalArgumentException("Multiple groups referenced the same tag " + tag + " held by "
|
||||||
|
+ groups.stream().map(Identifier::toString).collect(Collectors.joining())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return CompletableFuture.allOf(categoriesCollector.upload(writer), dietsCollector.upload(writer));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,123 @@
|
||||||
|
package com.minelittlepony.unicopia.datagen.providers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
import com.minelittlepony.unicopia.UConventionalTags;
|
||||||
|
import com.minelittlepony.unicopia.UTags;
|
||||||
|
import com.minelittlepony.unicopia.Unicopia;
|
||||||
|
import com.minelittlepony.unicopia.diet.FoodGroupEffects;
|
||||||
|
import com.minelittlepony.unicopia.diet.affliction.Affliction;
|
||||||
|
import com.minelittlepony.unicopia.diet.affliction.CompoundAffliction;
|
||||||
|
import com.minelittlepony.unicopia.diet.affliction.HealingAffliction;
|
||||||
|
import com.minelittlepony.unicopia.diet.affliction.LoseHungerAffliction;
|
||||||
|
import com.minelittlepony.unicopia.diet.affliction.Range;
|
||||||
|
import com.minelittlepony.unicopia.diet.affliction.StatusEffectAffliction;
|
||||||
|
import com.minelittlepony.unicopia.entity.effect.UEffects;
|
||||||
|
import com.minelittlepony.unicopia.item.UFoodComponents;
|
||||||
|
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.item.FoodComponent;
|
||||||
|
import net.minecraft.item.FoodComponents;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.registry.tag.ItemTags;
|
||||||
|
import net.minecraft.registry.tag.TagKey;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class FoodGroupsGenerator {
|
||||||
|
public void generate(BiConsumer<Identifier, FoodGroupEffects.Builder> exporter) {
|
||||||
|
exporter.accept(Unicopia.id("baked_goods"), new FoodGroupEffects.Builder().tag(UTags.Items.BAKED_GOODS).food(FoodComponents.BREAD));
|
||||||
|
exporter.accept(Unicopia.id("bat_ponys_delight"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.MANGOES).food(UFoodComponents.MANGO));
|
||||||
|
exporter.accept(Unicopia.id("candy"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.CANDY).food(UFoodComponents.CANDY));
|
||||||
|
exporter.accept(Unicopia.id("desserts"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.DESSERTS).food(FoodComponents.COOKIE));
|
||||||
|
exporter.accept(Unicopia.id("fruit"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.FRUITS).food(UFoodComponents.BANANA));
|
||||||
|
exporter.accept(Unicopia.id("rocks"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.ROCKS).tag(UTags.Items.ROCK_STEWS).food(FoodComponents.MUSHROOM_STEW));
|
||||||
|
exporter.accept(Unicopia.id("shells"), new FoodGroupEffects.Builder().tag(UTags.Items.SHELLS).food(UFoodComponents.SHELL));
|
||||||
|
exporter.accept(Unicopia.id("special_shells"), new FoodGroupEffects.Builder().tag(UTags.Items.SPECIAL_SHELLS).food(UFoodComponents.SHELLY));
|
||||||
|
exporter.accept(Unicopia.id("love"), new FoodGroupEffects.Builder().tag(UTags.Items.CONTAINER_WITH_LOVE).food(UFoodComponents.LOVE_MUG).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(50), Range.of(2), 0),
|
||||||
|
new LoseHungerAffliction(0.5F)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("nuts_and_seeds"), new FoodGroupEffects.Builder()
|
||||||
|
.tag(UConventionalTags.Items.GRAIN).tag(UConventionalTags.Items.NUTS).tag(UConventionalTags.Items.SEEDS)
|
||||||
|
.food(UFoodComponents.BANANA)
|
||||||
|
);
|
||||||
|
exporter.accept(Unicopia.id("pinecone"), new FoodGroupEffects.Builder().tag(UConventionalTags.Items.PINECONES).food(UFoodComponents.PINECONE).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new HealingAffliction(1)
|
||||||
|
))));
|
||||||
|
|
||||||
|
provideMeatCategory("fish",
|
||||||
|
UConventionalTags.Items.COOKED_FISH, UConventionalTags.Items.RAW_FISH, UConventionalTags.Items.ROTTEN_FISH,
|
||||||
|
FoodComponents.COOKED_COD, FoodComponents.COD, FoodComponents.ROTTEN_FLESH, exporter);
|
||||||
|
provideMeatCategory("meat",
|
||||||
|
UConventionalTags.Items.COOKED_MEAT, UConventionalTags.Items.RAW_MEAT, UConventionalTags.Items.ROTTEN_MEAT,
|
||||||
|
FoodComponents.COOKED_BEEF, FoodComponents.BEEF, FoodComponents.ROTTEN_FLESH, exporter);
|
||||||
|
provideMeatCategory("insect",
|
||||||
|
UConventionalTags.Items.COOKED_INSECT, UConventionalTags.Items.RAW_INSECT, UConventionalTags.Items.ROTTEN_INSECT,
|
||||||
|
FoodComponents.COOKED_BEEF, FoodComponents.BEEF, FoodComponents.ROTTEN_FLESH, exporter);
|
||||||
|
provideVegetableCategory("sea_vegetable",
|
||||||
|
UTags.Items.HIGH_QUALITY_SEA_VEGETABLES, UTags.Items.LOW_QUALITY_SEA_VEGETABLES,
|
||||||
|
FoodComponents.COOKED_BEEF, FoodComponents.BEEF, exporter);
|
||||||
|
|
||||||
|
exporter.accept(Unicopia.id("foraging/blinding"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_BLINDING).food(4, 0.2F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.BLINDNESS, Range.of(30), Range.of(0), 50),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 12)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/dangerous"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_DANGEROUS).food(3, 0.3F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(250), Range.of(2), 4)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/edible_filling"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_FILLING).food(17, 0.6F));
|
||||||
|
exporter.accept(Unicopia.id("foraging/edible"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_SAFE).food(2, 1));
|
||||||
|
exporter.accept(Unicopia.id("foraging/leafy_greens"), new FoodGroupEffects.Builder().tag(ItemTags.LEAVES).food(1, 1.4F));
|
||||||
|
exporter.accept(Unicopia.id("foraging/nauseating"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_NAUSEATING).food(5, 0.5F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.WEAKNESS, Range.of(200), Range.of(1), 30),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(200), Range.of(2), 0)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/prickly"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_PRICKLY).food(0, 1.5F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.INSTANT_DAMAGE, Range.of(1), Range.of(0), 30)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/glowing"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_GLOWING).food(1, 1.6F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.GLOWING, Range.of(30), Range.of(0), 30),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 0)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/risky"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_RISKY).food(9, 1.1F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 80)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/severely_nauseating"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_SEVERE_NAUSEATING).food(3, 0.9F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.WEAKNESS, Range.of(200), Range.of(1), 0),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 80)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/severely_prickly"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_SEVERE_PRICKLY).food(2, 0.9F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.INSTANT_DAMAGE, Range.of(1), Range.of(0), 0),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 80)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id("foraging/strengthening"), new FoodGroupEffects.Builder().tag(UTags.Items.FORAGE_STRENGHENING).food(4, 0.2F).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.STRENGTH, Range.of(1300), Range.of(0), 0),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 70)
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void provideMeatCategory(String name,
|
||||||
|
TagKey<Item> cookedTag, TagKey<Item> rawTag, TagKey<Item> rottenTag,
|
||||||
|
FoodComponent cooked, FoodComponent raw, FoodComponent rotten,
|
||||||
|
BiConsumer<Identifier, FoodGroupEffects.Builder> exporter) {
|
||||||
|
exporter.accept(Unicopia.id(name + "/cooked"), new FoodGroupEffects.Builder().tag(cookedTag).food(cooked).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 25)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id(name + "/raw"), new FoodGroupEffects.Builder().tag(rawTag).food(raw).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.POISON, Range.of(45), Range.of(2), 80),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 65)
|
||||||
|
))));
|
||||||
|
exporter.accept(Unicopia.id(name + "/rotten"), new FoodGroupEffects.Builder().tag(rottenTag).food(rotten).ailment(new CompoundAffliction(List.<Affliction>of(
|
||||||
|
new StatusEffectAffliction(StatusEffects.POISON, Range.of(45), Range.of(2), 80),
|
||||||
|
new StatusEffectAffliction(UEffects.FOOD_POISONING, Range.of(100), Range.of(2), 95)
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void provideVegetableCategory(String name,
|
||||||
|
TagKey<Item> cookedTag, TagKey<Item> rawTag,
|
||||||
|
FoodComponent cooked, FoodComponent raw,
|
||||||
|
BiConsumer<Identifier, FoodGroupEffects.Builder> exporter) {
|
||||||
|
exporter.accept(Unicopia.id(name + "/cooked"), new FoodGroupEffects.Builder().tag(cookedTag).food(cooked));
|
||||||
|
exporter.accept(Unicopia.id(name + "/raw"), new FoodGroupEffects.Builder().tag(rawTag).food(raw));
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,17 +12,16 @@ import com.minelittlepony.unicopia.server.world.UTreeGen;
|
||||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.data.DataOutput;
|
import net.minecraft.data.DataOutput;
|
||||||
import net.minecraft.data.DataOutput.PathResolver;
|
|
||||||
import net.minecraft.registry.Registries;
|
import net.minecraft.registry.Registries;
|
||||||
import net.minecraft.data.DataProvider;
|
import net.minecraft.data.DataProvider;
|
||||||
import net.minecraft.data.DataWriter;
|
import net.minecraft.data.DataWriter;
|
||||||
|
|
||||||
public class SeasonsGrowthRatesProvider implements DataProvider {
|
public class SeasonsGrowthRatesProvider implements DataProvider {
|
||||||
|
|
||||||
private final PathResolver pathResolver;
|
private final DataCollector collectedData;
|
||||||
|
|
||||||
public SeasonsGrowthRatesProvider(FabricDataOutput output) {
|
public SeasonsGrowthRatesProvider(FabricDataOutput output) {
|
||||||
this.pathResolver = output.getResolver(DataOutput.OutputType.DATA_PACK, "seasons/crop");
|
this.collectedData = new DataCollector(output.getResolver(DataOutput.OutputType.DATA_PACK, "seasons/crop"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,7 +31,6 @@ public class SeasonsGrowthRatesProvider implements DataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<?> run(DataWriter writer) {
|
public CompletableFuture<?> run(DataWriter writer) {
|
||||||
DataCollector collectedData = new DataCollector(pathResolver);
|
|
||||||
var exporter = collectedData.prime();
|
var exporter = collectedData.prime();
|
||||||
generate((block, crop) -> {
|
generate((block, crop) -> {
|
||||||
exporter.accept(Registries.BLOCK.getId(block), crop::toJson);
|
exporter.accept(Registries.BLOCK.getId(block), crop::toJson);
|
||||||
|
|
|
@ -130,7 +130,14 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||||
getOrCreateTagBuilder(UTags.Items.SHELLS).add(Items.NAUTILUS_SHELL, UItems.CLAM_SHELL, UItems.SCALLOP_SHELL, UItems.TURRET_SHELL);
|
getOrCreateTagBuilder(UTags.Items.SHELLS).add(Items.NAUTILUS_SHELL, UItems.CLAM_SHELL, UItems.SCALLOP_SHELL, UItems.TURRET_SHELL);
|
||||||
getOrCreateTagBuilder(UTags.Items.SPECIAL_SHELLS).add(UItems.SHELLY);
|
getOrCreateTagBuilder(UTags.Items.SPECIAL_SHELLS).add(UItems.SHELLY);
|
||||||
getOrCreateTagBuilder(UTags.Items.ROCK_STEWS).add(UItems.ROCK_STEW);
|
getOrCreateTagBuilder(UTags.Items.ROCK_STEWS).add(UItems.ROCK_STEW);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.HIGH_QUALITY_SEA_VEGETABLES)
|
||||||
|
.add(Items.DRIED_KELP_BLOCK, Items.GLOW_LICHEN)
|
||||||
|
.forceAddTag(UConventionalTags.Items.CORAL_BLOCKS);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.LOW_QUALITY_SEA_VEGETABLES)
|
||||||
|
.add(Items.KELP, Items.DRIED_KELP, Items.SEAGRASS, Items.SEA_PICKLE)
|
||||||
|
.forceAddTag(UConventionalTags.Items.CORALS).forceAddTag(UConventionalTags.Items.CORAL_FANS);
|
||||||
|
|
||||||
|
exportForagingTags();
|
||||||
exportFarmersDelightItems();
|
exportFarmersDelightItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +169,23 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||||
copy(UTags.Blocks.CHITIN_BLOCKS, UTags.Items.CHITIN_BLOCKS);
|
copy(UTags.Blocks.CHITIN_BLOCKS, UTags.Items.CHITIN_BLOCKS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void exportForagingTags() {
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_BLINDING).add(Items.OXEYE_DAISY);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_DANGEROUS).add(Items.POPPY, Items.LILY_OF_THE_VALLEY);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_FILLING).add(Items.HAY_BLOCK);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_SAFE).add(Items.BLUE_ORCHID, Items.RED_TULIP, Items.ORANGE_TULIP,
|
||||||
|
Items.PINK_TULIP, Items.CORNFLOWER, Items.PEONY, Items.SUNFLOWER, Items.DANDELION, Items.LILAC, Items.TALL_GRASS,
|
||||||
|
Items.DEAD_BUSH, Items.PINK_PETALS
|
||||||
|
).forceAddTag(UConventionalTags.Items.MUSHROOMS).forceAddTag(ItemTags.SAPLINGS);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_NAUSEATING).add(Items.GRASS, UItems.CIDER);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_PRICKLY).add(Items.ROSE_BUSH).forceAddTag(ItemTags.SAPLINGS);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_GLOWING).add(Items.AZURE_BLUET, Items.TORCHFLOWER);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_RISKY).add(Items.ALLIUM, Items.WHITE_TULIP, UItems.BURNED_JUICE);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_STRENGHENING).add(Items.FERN);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_SEVERE_NAUSEATING).add(Items.PITCHER_PLANT);
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_SEVERE_PRICKLY).add(Items.LARGE_FERN);
|
||||||
|
}
|
||||||
|
|
||||||
private void exportConventionalTags() {
|
private void exportConventionalTags() {
|
||||||
copy(UConventionalTags.Blocks.CONCRETES, UConventionalTags.Items.CONCRETES);
|
copy(UConventionalTags.Blocks.CONCRETES, UConventionalTags.Items.CONCRETES);
|
||||||
copy(UConventionalTags.Blocks.CONCRETE_POWDERS, UConventionalTags.Items.CONCRETE_POWDERS);
|
copy(UConventionalTags.Blocks.CONCRETE_POWDERS, UConventionalTags.Items.CONCRETE_POWDERS);
|
||||||
|
@ -199,7 +223,9 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||||
.addOptionalTag(new Identifier("c", "raw_pork"))
|
.addOptionalTag(new Identifier("c", "raw_pork"))
|
||||||
.addOptionalTag(new Identifier("c", "lemon_chickens"));
|
.addOptionalTag(new Identifier("c", "lemon_chickens"));
|
||||||
getOrCreateTagBuilder(UConventionalTags.Items.ROTTEN_MEAT).add(Items.ROTTEN_FLESH);
|
getOrCreateTagBuilder(UConventionalTags.Items.ROTTEN_MEAT).add(Items.ROTTEN_FLESH);
|
||||||
getOrCreateTagBuilder(UConventionalTags.Items.COOKED_INSECT).add(Items.FERMENTED_SPIDER_EYE);
|
getOrCreateTagBuilder(UConventionalTags.Items.ROTTEN_FISH);//.add(Items.ROTTEN_FLESH); TODO:
|
||||||
|
getOrCreateTagBuilder(UConventionalTags.Items.ROTTEN_INSECT).add(Items.FERMENTED_SPIDER_EYE);
|
||||||
|
getOrCreateTagBuilder(UConventionalTags.Items.COOKED_INSECT);//.add(Items.FERMENTED_SPIDER_EYE);
|
||||||
getOrCreateTagBuilder(UConventionalTags.Items.RAW_INSECT).add(Items.SPIDER_EYE, UItems.BUTTERFLY, UItems.WHEAT_WORMS, UBlocks.WORM_BLOCK.asItem());
|
getOrCreateTagBuilder(UConventionalTags.Items.RAW_INSECT).add(Items.SPIDER_EYE, UItems.BUTTERFLY, UItems.WHEAT_WORMS, UBlocks.WORM_BLOCK.asItem());
|
||||||
getOrCreateTagBuilder(UConventionalTags.Items.WORMS).add(UItems.WHEAT_WORMS);
|
getOrCreateTagBuilder(UConventionalTags.Items.WORMS).add(UItems.WHEAT_WORMS);
|
||||||
getOrCreateTagBuilder(UConventionalTags.Items.STICKS).add(Items.STICK);
|
getOrCreateTagBuilder(UConventionalTags.Items.STICKS).add(Items.STICK);
|
||||||
|
@ -295,5 +321,24 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||||
.addOptional(new Identifier("farmersdelight", "raw_pasta"))
|
.addOptional(new Identifier("farmersdelight", "raw_pasta"))
|
||||||
.addOptional(new Identifier("farmersdelight", "pie_crust"))
|
.addOptional(new Identifier("farmersdelight", "pie_crust"))
|
||||||
.addOptional(new Identifier("farmersdelight", "egg_sandwich"));
|
.addOptional(new Identifier("farmersdelight", "egg_sandwich"));
|
||||||
|
getOrCreateTagBuilder(UTags.Items.HIGH_QUALITY_SEA_VEGETABLES)
|
||||||
|
.addOptional(new Identifier("farmersdelight", "kelp_roll"));
|
||||||
|
getOrCreateTagBuilder(UTags.Items.LOW_QUALITY_SEA_VEGETABLES)
|
||||||
|
.addOptional(new Identifier("farmersdelight", "kelp_roll_slice"));
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_FILLING)
|
||||||
|
.addOptional(new Identifier("farmersdelight", "horse_feed"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "rice_bale"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "straw_bale"));
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_SAFE)
|
||||||
|
.addOptional(new Identifier("farmersdelight", "sandy_shrub"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "wild_cabbages"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "wild_onions"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "wild_carrots"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "wild_beetroots"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "wild_rice"));
|
||||||
|
getOrCreateTagBuilder(UTags.Items.FORAGE_RISKY)
|
||||||
|
.addOptional(new Identifier("farmersdelight", "wild_tomatoes"))
|
||||||
|
.addOptional(new Identifier("farmersdelight", "wild_potatoes"))
|
||||||
|
.addOptionalTag(new Identifier("c", "meads"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,23 +17,31 @@ import net.minecraft.util.Util;
|
||||||
|
|
||||||
public record FoodGroup(
|
public record FoodGroup(
|
||||||
Identifier id,
|
Identifier id,
|
||||||
List<FoodGroupKey> tags,
|
FoodGroupEffects attributes) implements Effect {
|
||||||
Optional<FoodComponent> foodComponent,
|
|
||||||
Ailment ailment) implements Effect {
|
|
||||||
public static final Codec<FoodGroupEffects> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
public static final Codec<FoodGroupEffects> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
||||||
FoodGroupKey.TAG_CODEC.listOf().fieldOf("tags").forGetter(FoodGroupEffects::tags),
|
FoodGroupKey.TAG_CODEC.listOf().fieldOf("tags").forGetter(FoodGroupEffects::tags),
|
||||||
FoodAttributes.CODEC.optionalFieldOf("food_component").forGetter(FoodGroupEffects::foodComponent),
|
FoodAttributes.CODEC.optionalFieldOf("food_component").forGetter(FoodGroupEffects::foodComponent),
|
||||||
Ailment.CODEC.fieldOf("ailment").forGetter(FoodGroupEffects::ailment)
|
Ailment.CODEC.fieldOf("ailment").forGetter(FoodGroupEffects::ailment)
|
||||||
).apply(instance, FoodGroupEffects::new));
|
).apply(instance, FoodGroupEffects::new));
|
||||||
|
|
||||||
public FoodGroup(Identifier id, Effect effect) {
|
|
||||||
this(id, effect.tags(), effect.foodComponent(), effect.ailment());
|
|
||||||
}
|
|
||||||
|
|
||||||
public FoodGroup(PacketByteBuf buffer) {
|
public FoodGroup(PacketByteBuf buffer) {
|
||||||
this(buffer.readIdentifier(), new FoodGroupEffects(buffer, FoodGroupKey.TAG_ID_LOOKUP));
|
this(buffer.readIdentifier(), new FoodGroupEffects(buffer, FoodGroupKey.TAG_ID_LOOKUP));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FoodGroupKey> tags() {
|
||||||
|
return attributes.tags();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<FoodComponent> foodComponent() {
|
||||||
|
return attributes.foodComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ailment ailment() {
|
||||||
|
return attributes.ailment();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void appendTooltip(ItemStack stack, List<Text> tooltip, TooltipContext context) {
|
public void appendTooltip(ItemStack stack, List<Text> tooltip, TooltipContext context) {
|
||||||
tooltip.add(Text.literal(" ").append(Text.translatable(Util.createTranslationKey("food_group", id()))).formatted(Formatting.GRAY));
|
tooltip.add(Text.literal(" ").append(Text.translatable(Util.createTranslationKey("food_group", id()))).formatted(Formatting.GRAY));
|
||||||
|
|
|
@ -1,15 +1,22 @@
|
||||||
package com.minelittlepony.unicopia.diet;
|
package com.minelittlepony.unicopia.diet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
import com.minelittlepony.unicopia.diet.affliction.Affliction;
|
||||||
|
import com.minelittlepony.unicopia.item.UFoodComponents;
|
||||||
import com.mojang.serialization.Codec;
|
import com.mojang.serialization.Codec;
|
||||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
|
||||||
import net.minecraft.client.item.TooltipContext;
|
import net.minecraft.client.item.TooltipContext;
|
||||||
import net.minecraft.item.FoodComponent;
|
import net.minecraft.item.FoodComponent;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.registry.tag.TagKey;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
@ -39,4 +46,41 @@ public record FoodGroupEffects(
|
||||||
});
|
});
|
||||||
Effect.super.appendTooltip(stack, tooltip, context);
|
Effect.super.appendTooltip(stack, tooltip, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final class Builder {
|
||||||
|
private final List<FoodGroupKey> tags = new ArrayList<>();
|
||||||
|
private Optional<FoodComponent> foodComponent = Optional.empty();
|
||||||
|
private Ailment ailment = new Ailment(Affliction.EMPTY);
|
||||||
|
|
||||||
|
public Builder tag(Identifier tag) {
|
||||||
|
return tag(TagKey.of(RegistryKeys.ITEM, tag));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder tag(TagKey<Item> tag) {
|
||||||
|
tags.add(FoodGroupKey.TAG_LOOKUP.apply(tag));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder ailment(Affliction affliction) {
|
||||||
|
ailment = new Ailment(affliction);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder food(int hunger, float saturation) {
|
||||||
|
return food(UFoodComponents.builder(hunger, saturation));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder food(FoodComponent.Builder food) {
|
||||||
|
return food(food.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder food(FoodComponent food) {
|
||||||
|
foodComponent = Optional.of(food);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FoodGroupEffects build() {
|
||||||
|
return new FoodGroupEffects(tags, foodComponent, ailment);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -27,6 +27,16 @@ public interface FoodGroupKey {
|
||||||
var group = PonyDiets.getEffect(id);
|
var group = PonyDiets.getEffect(id);
|
||||||
return group != null && group.test(stack);
|
return group != null && group.test(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
return o == this && (o instanceof FoodGroupKey k && k.id().equals(id()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return id().hashCode();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
Function<TagKey<Item>, FoodGroupKey> TAG_LOOKUP = Util.memoize(tag -> {
|
Function<TagKey<Item>, FoodGroupKey> TAG_LOOKUP = Util.memoize(tag -> {
|
||||||
|
@ -48,6 +58,16 @@ public interface FoodGroupKey {
|
||||||
|
|
||||||
return stack.isIn(tag);
|
return stack.isIn(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
return o == this && (o instanceof FoodGroupKey k && k.id().equals(id()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return id().hashCode();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
Function<Identifier, FoodGroupKey> TAG_ID_LOOKUP = id -> TAG_LOOKUP.apply(TagKey.of(RegistryKeys.ITEM, id));
|
Function<Identifier, FoodGroupKey> TAG_ID_LOOKUP = id -> TAG_LOOKUP.apply(TagKey.of(RegistryKeys.ITEM, id));
|
||||||
|
|
|
@ -37,7 +37,7 @@ public interface Affliction {
|
||||||
affliction -> ((CompoundAffliction)affliction).afflictions
|
affliction -> ((CompoundAffliction)affliction).afflictions
|
||||||
)).xmap(
|
)).xmap(
|
||||||
either -> either.left().or(either::right).get(),
|
either -> either.left().or(either::right).get(),
|
||||||
affliction -> affliction instanceof CompoundAffliction ? Either.left(affliction) : Either.right(affliction)
|
affliction -> affliction instanceof CompoundAffliction ? Either.right(affliction) : Either.left(affliction)
|
||||||
);
|
);
|
||||||
|
|
||||||
void afflict(PlayerEntity player, ItemStack stack);
|
void afflict(PlayerEntity player, ItemStack stack);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
class CompoundAffliction implements Affliction {
|
public class CompoundAffliction implements Affliction {
|
||||||
public final List<Affliction> afflictions;
|
public final List<Affliction> afflictions;
|
||||||
private final Text name;
|
private final Text name;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
record HealingAffliction(float health) implements Affliction {
|
public record HealingAffliction(float health) implements Affliction {
|
||||||
public static final Codec<HealingAffliction> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
public static final Codec<HealingAffliction> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
||||||
Codec.FLOAT.fieldOf("health").forGetter(HealingAffliction::health)
|
Codec.FLOAT.fieldOf("health").forGetter(HealingAffliction::health)
|
||||||
).apply(instance, HealingAffliction::new));
|
).apply(instance, HealingAffliction::new));
|
||||||
|
|
|
@ -7,7 +7,7 @@ import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.util.dynamic.Codecs;
|
import net.minecraft.util.dynamic.Codecs;
|
||||||
|
|
||||||
record Range(int min, int max) {
|
public record Range(int min, int max) {
|
||||||
public static final Codec<Range> CODEC = Codecs.xor(
|
public static final Codec<Range> CODEC = Codecs.xor(
|
||||||
Codec.INT.xmap(value -> Range.of(value, -1), range -> range.min()),
|
Codec.INT.xmap(value -> Range.of(value, -1), range -> range.min()),
|
||||||
RecordCodecBuilder.<Range>create(instance -> instance.group(
|
RecordCodecBuilder.<Range>create(instance -> instance.group(
|
||||||
|
@ -20,6 +20,10 @@ record Range(int min, int max) {
|
||||||
return new Range(min, max);
|
return new Range(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Range of(int exact) {
|
||||||
|
return of(exact, exact);
|
||||||
|
}
|
||||||
|
|
||||||
public static Range of(PacketByteBuf buffer) {
|
public static Range of(PacketByteBuf buffer) {
|
||||||
return of(buffer.readInt(), buffer.readInt());
|
return of(buffer.readInt(), buffer.readInt());
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.mojang.serialization.Codec;
|
||||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
|
||||||
import net.minecraft.entity.attribute.EntityAttributes;
|
import net.minecraft.entity.attribute.EntityAttributes;
|
||||||
|
import net.minecraft.entity.effect.StatusEffect;
|
||||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -11,25 +12,24 @@ import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.registry.Registries;
|
import net.minecraft.registry.Registries;
|
||||||
import net.minecraft.text.MutableText;
|
import net.minecraft.text.MutableText;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.StringHelper;
|
import net.minecraft.util.StringHelper;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
record StatusEffectAffliction(Identifier effect, Range seconds, Range amplifier, int chance) implements Affliction {
|
public record StatusEffectAffliction(StatusEffect effect, Range seconds, Range amplifier, int chance) implements Affliction {
|
||||||
public static final Codec<StatusEffectAffliction> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
public static final Codec<StatusEffectAffliction> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
||||||
Identifier.CODEC.fieldOf("effect").forGetter(StatusEffectAffliction::effect),
|
Registries.STATUS_EFFECT.getCodec().fieldOf("effect").forGetter(StatusEffectAffliction::effect),
|
||||||
Range.CODEC.fieldOf("seconds").forGetter(StatusEffectAffliction::seconds),
|
Range.CODEC.fieldOf("seconds").forGetter(StatusEffectAffliction::seconds),
|
||||||
Range.CODEC.optionalFieldOf("amplifier", Range.of(0, -1)).forGetter(StatusEffectAffliction::amplifier),
|
Range.CODEC.optionalFieldOf("amplifier", Range.of(0, -1)).forGetter(StatusEffectAffliction::amplifier),
|
||||||
Codec.INT.optionalFieldOf("chance", 0).forGetter(StatusEffectAffliction::chance)
|
Codec.INT.optionalFieldOf("chance", 0).forGetter(StatusEffectAffliction::chance)
|
||||||
).apply(instance, StatusEffectAffliction::new));
|
).apply(instance, StatusEffectAffliction::new));
|
||||||
|
|
||||||
public StatusEffectAffliction(PacketByteBuf buffer) {
|
public StatusEffectAffliction(PacketByteBuf buffer) {
|
||||||
this(buffer.readIdentifier(), Range.of(buffer), Range.of(buffer), buffer.readInt());
|
this(Registries.STATUS_EFFECT.get(buffer.readIdentifier()), Range.of(buffer), Range.of(buffer), buffer.readInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toBuffer(PacketByteBuf buffer) {
|
public void toBuffer(PacketByteBuf buffer) {
|
||||||
buffer.writeIdentifier(effect);
|
buffer.writeIdentifier(Registries.STATUS_EFFECT.getId(effect));
|
||||||
seconds.toBuffer(buffer);
|
seconds.toBuffer(buffer);
|
||||||
amplifier.toBuffer(buffer);
|
amplifier.toBuffer(buffer);
|
||||||
buffer.writeInt(chance);
|
buffer.writeInt(chance);
|
||||||
|
@ -45,35 +45,31 @@ record StatusEffectAffliction(Identifier effect, Range seconds, Range amplifier,
|
||||||
if (chance > 0 && player.getWorld().random.nextInt(chance) > 0) {
|
if (chance > 0 && player.getWorld().random.nextInt(chance) > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Registries.STATUS_EFFECT.getOrEmpty(effect).ifPresent(effect -> {
|
float health = player.getHealth();
|
||||||
float health = player.getHealth();
|
StatusEffectInstance current = player.getStatusEffect(effect);
|
||||||
StatusEffectInstance current = player.getStatusEffect(effect);
|
player.addStatusEffect(new StatusEffectInstance(effect,
|
||||||
player.addStatusEffect(new StatusEffectInstance(effect,
|
seconds.getClamped(current == null ? 0 : current.getDuration(), 20),
|
||||||
seconds.getClamped(current == null ? 0 : current.getDuration(), 20),
|
amplifier.getClamped(current == null ? 0 : current.getAmplifier(), 1)
|
||||||
amplifier.getClamped(current == null ? 0 : current.getAmplifier(), 1)
|
));
|
||||||
));
|
// keep original health
|
||||||
// keep original health
|
if (effect.getAttributeModifiers().containsKey(EntityAttributes.GENERIC_MAX_HEALTH)) {
|
||||||
if (effect.getAttributeModifiers().containsKey(EntityAttributes.GENERIC_MAX_HEALTH)) {
|
player.setHealth(MathHelper.clamp(health, 0, player.getMaxHealth()));
|
||||||
player.setHealth(MathHelper.clamp(health, 0, player.getMaxHealth()));
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Text getName() {
|
public Text getName() {
|
||||||
return Registries.STATUS_EFFECT.getOrEmpty(effect).map(effect -> {
|
MutableText text = effect.getName().copy();
|
||||||
MutableText text = effect.getName().copy();
|
|
||||||
|
|
||||||
if (amplifier.min() > 0) {
|
if (amplifier.min() > 0) {
|
||||||
text = Text.translatable("potion.withAmplifier", text, Text.translatable("potion.potency." + (amplifier.min())));
|
text = Text.translatable("potion.withAmplifier", text, Text.translatable("potion.potency." + (amplifier.min())));
|
||||||
}
|
}
|
||||||
|
|
||||||
text = Text.translatable("potion.withDuration", text, StringHelper.formatTicks(seconds.min() * 20));
|
text = Text.translatable("potion.withDuration", text, StringHelper.formatTicks(seconds.min() * 20));
|
||||||
|
|
||||||
if (chance > 0) {
|
if (chance > 0) {
|
||||||
text = Text.translatable("potion.withChance", chance, text);
|
text = Text.translatable("potion.withChance", chance, text);
|
||||||
}
|
}
|
||||||
return (Text)text;
|
return text;
|
||||||
}).orElse(EMPTY.getName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -30,10 +30,6 @@ public interface UFoodComponents {
|
||||||
FoodComponent CHOCOLATE_OATMEAL_COOKIE = builder(3, 0.4F).build();
|
FoodComponent CHOCOLATE_OATMEAL_COOKIE = builder(3, 0.4F).build();
|
||||||
FoodComponent SCONE = builder(2, 0.2F).build();
|
FoodComponent SCONE = builder(2, 0.2F).build();
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
FoodComponent RANDOM_FOLIAGE = builder(2, 1).build();
|
|
||||||
@Deprecated
|
|
||||||
FoodComponent RANDOM_FOLIAGE_FILLING = builder(18, 1).build();
|
|
||||||
FoodComponent WORMS = builder(1, 1.5F).alwaysEdible().meat().build();
|
FoodComponent WORMS = builder(1, 1.5F).alwaysEdible().meat().build();
|
||||||
FoodComponent INSECTS = builder(1, 0).alwaysEdible().build();
|
FoodComponent INSECTS = builder(1, 0).alwaysEdible().build();
|
||||||
|
|
||||||
|
@ -62,9 +58,7 @@ public interface UFoodComponents {
|
||||||
|
|
||||||
FoodComponent POISON_JOKE = builder(0, 0F).alwaysEdible().snack().build();
|
FoodComponent POISON_JOKE = builder(0, 0F).alwaysEdible().snack().build();
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
FoodComponent SHELL = builder(3, 5).build();
|
FoodComponent SHELL = builder(3, 5).build();
|
||||||
@Deprecated
|
|
||||||
FoodComponent SHELLY = builder(6, 7).build();
|
FoodComponent SHELLY = builder(6, 7).build();
|
||||||
|
|
||||||
static FoodComponent.Builder builder(int hunger, float saturation) {
|
static FoodComponent.Builder builder(int hunger, float saturation) {
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
{ "id": "#c:mushrooms", "required": false },
|
|
||||||
{ "id": "#c:saplings", "required": false },
|
|
||||||
{ "id": "farmersdelight:sandy_shrub", "required": false },
|
|
||||||
{ "id": "farmersdelight:wild_cabbages", "required": false },
|
|
||||||
{ "id": "farmersdelight:wild_onions", "required": false },
|
|
||||||
{ "id": "farmersdelight:wild_carrots", "required": false },
|
|
||||||
{ "id": "farmersdelight:wild_beetroots", "required": false },
|
|
||||||
{ "id": "farmersdelight:wild_rice", "required": false }
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
{ "id": "farmersdelight:horse_feed", "required": false },
|
|
||||||
{ "id": "farmersdelight:rice_bale", "required": false },
|
|
||||||
{ "id": "farmersdelight:straw_bale", "required": false }
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
{ "id": "#c:meads", "required": false },
|
|
||||||
{ "id": "farmersdelight:wild_tomatoes", "required": false },
|
|
||||||
{ "id": "farmersdelight:wild_potatoes", "required": false }
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:baked_goods" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:mangoes" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 0.1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": []
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:candy" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:desserts" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:cooked_fish" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 0.1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:raw_fish" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 0.1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:poison",
|
|
||||||
"seconds": 45,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:rotten_fish" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 0.1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:poison",
|
|
||||||
"seconds": 45,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 400,
|
|
||||||
"amplifier": 3,
|
|
||||||
"chance": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_blinding" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:blindness",
|
|
||||||
"seconds": 30,
|
|
||||||
"amplifier": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_dangerous" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 250,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 4
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_edible" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": []
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_edible_filling" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 18,
|
|
||||||
"saturation": 9
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": []
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "minecraft:leaves" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1.5
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": []
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_moderate" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 40
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_nauseating" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:weakness",
|
|
||||||
"seconds": 200,
|
|
||||||
"amplifier": 1,
|
|
||||||
"chance": 30
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_prickly" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:instant_damage",
|
|
||||||
"seconds": 1,
|
|
||||||
"amplifier": 0,
|
|
||||||
"chance": 30
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_radioactive" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:glowing",
|
|
||||||
"seconds": 15,
|
|
||||||
"amplifier": 0,
|
|
||||||
"chance": 30
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_risky" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 80
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_severely_nauseating" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:weakness",
|
|
||||||
"seconds": 200,
|
|
||||||
"amplifier": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_severely_prickly" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:instant_damage",
|
|
||||||
"seconds": 1,
|
|
||||||
"amplifier": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/forage_strengthening" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:strength",
|
|
||||||
"seconds": 30,
|
|
||||||
"amplifier": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 10
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:fruits" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:cooked_insect" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 0.1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:raw_insect" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 6,
|
|
||||||
"saturation": 0.3
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:container_with_love" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 0.4
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 50,
|
|
||||||
"amplifier": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "unicopia.affliction.love_sickness",
|
|
||||||
"type": "unicopia:lose_hunger",
|
|
||||||
"multiplier": 0.5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:cooked_meat" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 12,
|
|
||||||
"saturation": 1.2
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:raw_meat" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:poison",
|
|
||||||
"seconds": 45,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 100,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:rotten_meat" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"effect": "minecraft:poison",
|
|
||||||
"seconds": 45,
|
|
||||||
"amplifier": 2,
|
|
||||||
"chance": 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"effect": "unicopia:food_poisoning",
|
|
||||||
"seconds": 400,
|
|
||||||
"amplifier": 3,
|
|
||||||
"chance": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:grain", "c:nuts", "c:seeds" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 2,
|
|
||||||
"saturation": 2.5
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:pinecones" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 0.1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
{
|
|
||||||
"type": "unicopia:healing",
|
|
||||||
"health": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "c:rocks", "unicopia:rock_stews" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 1,
|
|
||||||
"saturation": 0.1
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": []
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/cooked_sea_vegitable", "c:coral_blocks" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 0,
|
|
||||||
"saturation": 0
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:food_types/raw_sea_vegitable", "c:corals", "c:coral_fans" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 0,
|
|
||||||
"saturation": 0
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:shells" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 0,
|
|
||||||
"saturation": 0
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": []
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"tags": [ "unicopia:special_shells" ],
|
|
||||||
"food_component": {
|
|
||||||
"hunger": 0,
|
|
||||||
"saturation": 0
|
|
||||||
},
|
|
||||||
"ailment": {
|
|
||||||
"effects": []
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:dried_kelp_block",
|
|
||||||
"minecraft:glow_lichen"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:oxeye_daisy"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:poppy",
|
|
||||||
"minecraft:lily_of_the_valley"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:blue_orchid",
|
|
||||||
"minecraft:red_tulip",
|
|
||||||
"minecraft:orange_tulip",
|
|
||||||
"minecraft:pink_tulip",
|
|
||||||
"minecraft:cornflower",
|
|
||||||
"minecraft:peony",
|
|
||||||
"minecraft:sunflower",
|
|
||||||
"minecraft:dandelion",
|
|
||||||
"minecraft:lilac",
|
|
||||||
"minecraft:tall_grass",
|
|
||||||
"minecraft:wheat",
|
|
||||||
"minecraft:dead_bush",
|
|
||||||
"minecraft:pink_petals",
|
|
||||||
"#c:foraging/edibles"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:hay_block",
|
|
||||||
"#c:foraging/edibles_filling"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:grass",
|
|
||||||
"unicopia:cider",
|
|
||||||
{ "id": "farmersdelight:rotten_tomato", "required": false }
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:rose_bush",
|
|
||||||
"#minecraft:saplings"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:azure_bluet",
|
|
||||||
"minecraft:torchflower"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:allium",
|
|
||||||
"minecraft:white_tulip",
|
|
||||||
"unicopia:burned_juice",
|
|
||||||
"#c:foraging/risky"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:pitcher_plant"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:large_fern"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:fern"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"minecraft:kelp",
|
|
||||||
"minecraft:dried_kelp",
|
|
||||||
"minecraft:seagrass",
|
|
||||||
"minecraft:sea_pickle",
|
|
||||||
{ "id": "farmersdelight:kelp_roll", "required": false },
|
|
||||||
{ "id": "farmersdelight:kelp_roll_slice", "required": false }
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Reference in a new issue