diff --git a/src/main/java/com/minelittlepony/unicopia/Debug.java b/src/main/java/com/minelittlepony/unicopia/Debug.java index 8cc8847e..2e3533df 100644 --- a/src/main/java/com/minelittlepony/unicopia/Debug.java +++ b/src/main/java/com/minelittlepony/unicopia/Debug.java @@ -51,7 +51,7 @@ public interface Debug { )).forEach((namespace, entries) -> { @SuppressWarnings("deprecation") var unregistered = entries.stream() - .filter(entry -> !entry.getValue().getRegistryEntry().isIn(UTags.HAS_NO_TRAITS) && SpellTraits.of(entry.getValue()).isEmpty()) + .filter(entry -> !entry.getValue().getRegistryEntry().isIn(UTags.Items.HAS_NO_TRAITS) && SpellTraits.of(entry.getValue()).isEmpty()) .map(entry -> { String id = entry.getKey().getValue().toString(); diff --git a/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java b/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java index 603c900e..bb55a662 100644 --- a/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java +++ b/src/main/java/com/minelittlepony/unicopia/UConventionalTags.java @@ -7,42 +7,42 @@ import net.minecraft.registry.tag.TagKey; import net.minecraft.util.Identifier; public interface UConventionalTags { - TagKey APPLES = item("apples"); - TagKey ACORNS = item("acorns"); - TagKey PINECONES = item("pinecones"); - TagKey PINEAPPLES = item("pineapples"); - TagKey BANANAS = item("bananas"); - TagKey STICKS = item("sticks"); - TagKey SEEDS = item("seeds"); - TagKey GRAIN = item("grain"); - TagKey NUTS = item("nuts"); - TagKey MUSHROOMS = item("mushrooms"); - TagKey MUFFINS = item("muffins"); - TagKey MANGOES = item("mangoes"); - TagKey OATMEALS = item("oatmeals"); - - TagKey FRUITS = item("fruits"); - - TagKey COOKED_FISH = item("cooked_fish"); - - TagKey CROPS_PEANUTS = item("crops/peanuts"); - TagKey TOOL_KNIVES = item("tools/knives"); - - static TagKey item(String name) { - return TagKey.of(RegistryKeys.ITEM, new Identifier("c", name)); - } - - static TagKey block(String name) { - return TagKey.of(RegistryKeys.BLOCK, new Identifier("c", name)); - } - interface Blocks { TagKey CONCRETE_POWDERS = block("concrete_powders"); TagKey CONCRETES = block("concretes"); + + private static TagKey block(String name) { + return TagKey.of(RegistryKeys.BLOCK, new Identifier("c", name)); + } } interface Items { TagKey CONCRETE_POWDERS = item("concrete_powders"); TagKey CONCRETES = item("concretes"); + + TagKey APPLES = item("apples"); + TagKey ACORNS = item("acorns"); + TagKey PINECONES = item("pinecones"); + TagKey PINEAPPLES = item("pineapples"); + TagKey BANANAS = item("bananas"); + TagKey STICKS = item("sticks"); + TagKey SEEDS = item("seeds"); + TagKey GRAIN = item("grain"); + TagKey NUTS = item("nuts"); + TagKey MUSHROOMS = item("mushrooms"); + TagKey MUFFINS = item("muffins"); + TagKey MANGOES = item("mangoes"); + TagKey OATMEALS = item("oatmeals"); + + TagKey FRUITS = item("fruits"); + + TagKey COOKED_FISH = item("cooked_fish"); + + TagKey CROPS_PEANUTS = item("crops/peanuts"); + TagKey TOOL_KNIVES = item("tools/knives"); + + private static TagKey item(String name) { + return TagKey.of(RegistryKeys.ITEM, new Identifier("c", name)); + } } } diff --git a/src/main/java/com/minelittlepony/unicopia/UTags.java b/src/main/java/com/minelittlepony/unicopia/UTags.java index 687d389d..82bd5417 100644 --- a/src/main/java/com/minelittlepony/unicopia/UTags.java +++ b/src/main/java/com/minelittlepony/unicopia/UTags.java @@ -11,58 +11,6 @@ import net.minecraft.util.Identifier; import net.minecraft.world.dimension.DimensionType; public interface UTags { - TagKey FRESH_APPLES = item("fresh_apples"); - - TagKey FALLS_SLOWLY = item("falls_slowly"); - TagKey PIES = item("pies"); - TagKey CAN_CUT_PIE = item("can_cut_pie"); - - TagKey MAGIC_FEATHERS = item("magic_feathers"); - - TagKey SHADES = item("shades"); - TagKey CHANGELING_EDIBLE = item("food_types/changeling_edible"); - TagKey SPOOKED_MOB_DROPS = item("spooked_mob_drops"); - TagKey HAS_NO_TRAITS = item("has_no_traits"); - TagKey IS_DELIVERED_AGGRESSIVELY = item("is_delivered_aggressively"); - TagKey FLOATS_ON_CLOUDS = item("floats_on_clouds"); - TagKey COOLS_OFF_KIRINS = item("cools_off_kirins"); - TagKey LOOT_BUG_HIGH_VALUE_DROPS = item("loot_bug_high_value_drops"); - - TagKey SHELLS = item("food_types/shells"); - - TagKey POLEARMS = item("polearms"); - TagKey HORSE_SHOES = item("horse_shoes"); - TagKey APPLE_SEEDS = item("apple_seeds"); - - TagKey BASKETS = item("baskets"); - TagKey BADGES = item("badges"); - TagKey WOOL_BED_SHEETS = item("wool_bed_sheets"); - TagKey BED_SHEETS = item("bed_sheets"); - TagKey CLOUD_JARS = item("cloud_jars"); - - TagKey FRAGILE = block("fragile"); - TagKey INTERESTING = block("interesting"); - TagKey CATAPULT_IMMUNE = block("catapult_immune"); - TagKey JARS = block("jars"); - - TagKey CRYSTAL_HEART_BASE = block("crystal_heart_base"); - TagKey CRYSTAL_HEART_ORNAMENT = block("crystal_heart_ornament"); - TagKey UNAFFECTED_BY_GROW_ABILITY = block("unaffected_by_grow_ability"); - TagKey KICKS_UP_DUST = block("kicks_up_dust"); - - TagKey POLEARM_MINEABLE = block("mineable/polearm"); - - TagKey> TRANSFORMABLE_ENTITIES = entity("transformable"); - - TagKey PINEAPPLE_EFFECTS = effect("pineapple_effects"); - - TagKey BREAKS_SUNGLASSES = damage("breaks_sunglasses"); - TagKey SPELLBOOK_IMMUNE_TO = damage("spellbook_immune_to"); - TagKey FROM_ROCKS = damage("from_rocks"); - TagKey FROM_HORSESHOES = damage("from_horseshoes"); - - TagKey HAS_NO_ATMOSPHERE = dimension("has_no_atmosphere"); - interface Items { TagKey ZAP_LOGS = item("zap_logs"); TagKey WAXED_ZAP_LOGS = item("waxed_zap_logs"); @@ -72,6 +20,47 @@ public interface UTags { TagKey CLOUD_STAIRS = item("cloud_stairs"); TagKey CLOUD_BLOCKS = item("cloud_blocks"); TagKey CHITIN_BLOCKS = item("chitin_blocks"); + + TagKey FRESH_APPLES = item("fresh_apples"); + + TagKey FALLS_SLOWLY = item("falls_slowly"); + TagKey PIES = item("pies"); + TagKey CAN_CUT_PIE = item("can_cut_pie"); + + TagKey MAGIC_FEATHERS = item("magic_feathers"); + + TagKey SHADES = item("shades"); + TagKey CHANGELING_EDIBLE = item("food_types/changeling_edible"); + TagKey SPOOKED_MOB_DROPS = item("spooked_mob_drops"); + TagKey HAS_NO_TRAITS = item("has_no_traits"); + TagKey IS_DELIVERED_AGGRESSIVELY = item("is_delivered_aggressively"); + TagKey FLOATS_ON_CLOUDS = item("floats_on_clouds"); + TagKey COOLS_OFF_KIRINS = item("cools_off_kirins"); + TagKey LOOT_BUG_HIGH_VALUE_DROPS = item("loot_bug_high_value_drops"); + + TagKey SHELLS = item("food_types/shells"); + + TagKey POLEARMS = item("polearms"); + TagKey HORSE_SHOES = item("horse_shoes"); + TagKey APPLE_SEEDS = item("apple_seeds"); + + TagKey BASKETS = item("baskets"); + TagKey BADGES = item("badges"); + TagKey WOOL_BED_SHEETS = item("wool_bed_sheets"); + TagKey BED_SHEETS = item("bed_sheets"); + TagKey CLOUD_JARS = item("cloud_jars"); + + TagKey GROUP_FORAGING = item("groups/foraging"); + TagKey GROUP_EARTH_PONY = item("groups/earth_pony"); + TagKey GROUP_UNICORN = item("groups/unicorn"); + TagKey GROUP_PEGASUS = item("groups/pegasus"); + TagKey GROUP_BAT_PONY = item("groups/bat_pony"); + TagKey GROUP_SEA_PONY = item("groups/sea_pony"); + TagKey GROUP_CHANGELING = item("groups/changeling"); + + private static TagKey item(String name) { + return TagKey.of(RegistryKeys.ITEM, Unicopia.id(name)); + } } interface Blocks { @@ -84,30 +73,57 @@ public interface UTags { TagKey CLOUD_BLOCKS = block("cloud_blocks"); TagKey CHITIN_BLOCKS = block("chitin_blocks"); + TagKey FRAGILE = block("fragile"); + TagKey INTERESTING = block("interesting"); + TagKey CATAPULT_IMMUNE = block("catapult_immune"); + TagKey JARS = block("jars"); + + TagKey CRYSTAL_HEART_BASE = block("crystal_heart_base"); + TagKey CRYSTAL_HEART_ORNAMENT = block("crystal_heart_ornament"); + TagKey UNAFFECTED_BY_GROW_ABILITY = block("unaffected_by_grow_ability"); + TagKey KICKS_UP_DUST = block("kicks_up_dust"); + + TagKey POLEARM_MINEABLE = block("mineable/polearm"); + TagKey BUTTERFLIES_SPAWNABLE_ON = block("butterflies_spawn_on"); + + private static TagKey block(String name) { + return TagKey.of(RegistryKeys.BLOCK, Unicopia.id(name)); + } } - static TagKey item(String name) { - return TagKey.of(RegistryKeys.ITEM, Unicopia.id(name)); + interface Entities { + TagKey> TRANSFORMABLE = entity("transformable"); + + private static TagKey> entity(String name) { + return TagKey.of(RegistryKeys.ENTITY_TYPE, Unicopia.id(name)); + } } - static TagKey block(String name) { - return TagKey.of(RegistryKeys.BLOCK, Unicopia.id(name)); + interface DamageTypes { + TagKey BREAKS_SUNGLASSES = damage("breaks_sunglasses"); + TagKey SPELLBOOK_IMMUNE_TO = damage("spellbook_immune_to"); + TagKey FROM_ROCKS = damage("from_rocks"); + TagKey FROM_HORSESHOES = damage("from_horseshoes"); + + private static TagKey damage(String name) { + return TagKey.of(RegistryKeys.DAMAGE_TYPE, Unicopia.id(name)); + } } - static TagKey> entity(String name) { - return TagKey.of(RegistryKeys.ENTITY_TYPE, Unicopia.id(name)); + interface DimensionTypes { + TagKey HAS_NO_ATMOSPHERE = dimension("has_no_atmosphere"); + + private static TagKey dimension(String name) { + return TagKey.of(RegistryKeys.DIMENSION_TYPE, new Identifier("c", name)); + } } - static TagKey effect(String name) { - return TagKey.of(RegistryKeys.STATUS_EFFECT, Unicopia.id(name)); - } + interface StatusEffects { + TagKey PINEAPPLE_EFFECTS = effect("pineapple_effects"); - static TagKey damage(String name) { - return TagKey.of(RegistryKeys.DAMAGE_TYPE, Unicopia.id(name)); - } - - static TagKey dimension(String name) { - return TagKey.of(RegistryKeys.DIMENSION_TYPE, new Identifier("c", name)); + private static TagKey effect(String name) { + return TagKey.of(RegistryKeys.STATUS_EFFECT, Unicopia.id(name)); + } } } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java index 61ab54d5..75cd435f 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java @@ -108,7 +108,7 @@ public class EarthPonyGrowAbility implements Ability { } } - if (w.getBlockState(pos).isIn(UTags.UNAFFECTED_BY_GROW_ABILITY)) { + if (w.getBlockState(pos).isIn(UTags.Blocks.UNAFFECTED_BY_GROW_ABILITY)) { return 0; } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java index b702400f..285266c9 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java @@ -162,7 +162,7 @@ public class EarthPonyStompAbility implements Ability { ParticleUtils.spawnParticle(player.getWorld(), UParticles.GROUND_POUND, player.getX(), player.getY() - 1, player.getZ(), 0, 0, 0); BlockState steppingState = player.getSteppingBlockState(); - if (steppingState.isIn(UTags.KICKS_UP_DUST)) { + if (steppingState.isIn(UTags.Blocks.KICKS_UP_DUST)) { ParticleUtils.spawnParticle(player.getWorld(), new BlockStateParticleEffect(UParticles.DUST_CLOUD, steppingState), player.getBlockPos().down().toCenterPos(), Vec3d.ZERO); } @@ -227,7 +227,7 @@ public class EarthPonyStompAbility implements Ability { w.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(state)); } - if (state.isIn(UTags.KICKS_UP_DUST)) { + if (state.isIn(UTags.Blocks.KICKS_UP_DUST)) { if (w.random.nextInt(4) == 0 && w.isAir(pos.up()) && w.getFluidState(pos.up()).isEmpty()) { ParticleUtils.spawnParticle(w, new BlockStateParticleEffect(UParticles.DUST_CLOUD, state), pos.up().toCenterPos(), VecHelper.supply(() -> w.random.nextTriangular(0, 0.1F))); } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java index ac244ea0..60319ba1 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java @@ -110,7 +110,7 @@ public class ScreechAbility implements Ability { if (living.getWorld().random.nextInt(MOB_SPOOK_PROBABILITY) == 0) { - RegistryUtils.pickRandom(living.getWorld(), UTags.SPOOKED_MOB_DROPS).ifPresent(drop -> { + RegistryUtils.pickRandom(living.getWorld(), UTags.Items.SPOOKED_MOB_DROPS).ifPresent(drop -> { living.dropStack(drop.getDefaultStack()); living.playSound(USounds.Vanilla.ENTITY_ITEM_PICKUP, 1, 0.1F); UCriteria.SPOOK_MOB.trigger(player.asEntity()); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java index a3339212..13445ea2 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RainboomAbilitySpell.java @@ -64,7 +64,7 @@ public class RainboomAbilitySpell extends AbstractSpell { }); EFFECT_RANGE.translate(source.getOrigin()).getBlockPositions().forEach(pos -> { BlockState state = source.asWorld().getBlockState(pos); - if (state.isIn(UTags.FRAGILE) && source.canModifyAt(pos, ModificationType.PHYSICAL)) { + if (state.isIn(UTags.Blocks.FRAGILE) && source.canModifyAt(pos, ModificationType.PHYSICAL)) { source.asWorld().breakBlock(pos, true); } }); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java index ec5cbf3e..ce440570 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/CatapultSpell.java @@ -86,7 +86,7 @@ public class CatapultSpell extends AbstractSpell implements ProjectileDelegate.B } BlockState state = world.getBlockState(bpos); - if (state.isIn(UTags.CATAPULT_IMMUNE)) { + if (state.isIn(UTags.Blocks.CATAPULT_IMMUNE)) { return; } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java index e26152f0..4d507d1d 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/TransformationSpell.java @@ -66,7 +66,7 @@ public class TransformationSpell extends AbstractSpell implements ProjectileDele @SuppressWarnings("unchecked") private Optional> pickType(EntityType except, World world) { - Set> options = RegistryUtils.valuesForTag(world, UTags.TRANSFORMABLE_ENTITIES).collect(Collectors.toSet()); + Set> options = RegistryUtils.valuesForTag(world, UTags.Entities.TRANSFORMABLE).collect(Collectors.toSet()); if (except.getSpawnGroup() == SpawnGroup.MONSTER) { options.removeIf(t -> t.getSpawnGroup() == SpawnGroup.MONSTER); } else { diff --git a/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java b/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java index b7c2be5b..33c85df0 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java @@ -71,7 +71,7 @@ public class PieBlock extends Block implements Waterloggable { if (world.isClient) { - if (itemStack.isIn(UTags.CAN_CUT_PIE)) { + if (itemStack.isIn(UTags.Items.CAN_CUT_PIE)) { return ActionResult.SUCCESS; } @@ -84,7 +84,7 @@ public class PieBlock extends Block implements Waterloggable { } } - if (itemStack.isIn(UTags.CAN_CUT_PIE)) { + if (itemStack.isIn(UTags.Items.CAN_CUT_PIE)) { SoundEmitter.playSoundAt(player, USounds.BLOCK_PIE_SLICE, SoundCategory.NEUTRAL, 1, 1); removeSlice(world, pos, state, player); itemStack.damage(1, player, p -> p.sendToolBreakStatus(hand)); diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java b/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java index ec3b17bb..2402dfab 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/PlayerPoser.java @@ -52,7 +52,7 @@ public class PlayerPoser { float pitchChange = -0.5F; float yawChange = 0.8F; - if (player.getStackInHand(rightHand).isIn(UTags.POLEARMS) && (!ponyRace.isEquine() || model.rightArm.pitch != 0)) { + if (player.getStackInHand(rightHand).isIn(UTags.Items.POLEARMS) && (!ponyRace.isEquine() || model.rightArm.pitch != 0)) { model.rightArm.pitch += pitchChange; model.rightArm.yaw += yawChange; if (player.handSwingTicks > 0 && rightHand == Hand.MAIN_HAND) { @@ -61,7 +61,7 @@ public class PlayerPoser { } } - if (player.getStackInHand(leftHand).isIn(UTags.POLEARMS) && (!ponyRace.isEquine() || model.leftArm.pitch != 0)) { + if (player.getStackInHand(leftHand).isIn(UTags.Items.POLEARMS) && (!ponyRace.isEquine() || model.leftArm.pitch != 0)) { model.leftArm.pitch += pitchChange; model.leftArm.yaw -= yawChange; if (player.handSwingTicks > 0 && leftHand == Hand.MAIN_HAND) { diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java index e0c2c349..a46d1306 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java @@ -73,27 +73,27 @@ public class UAdvancementsProvider extends FabricAdvancementProvider { private void generateEarthTribeAdvancementsTree(Consumer consumer, AdvancementDisplayBuilder.Parent parent) { parent.child(UItems.ROCK).criterion("has_rock", hasItems(UItems.ROCK)).build(consumer, "born_on_a_rock_farm").children(p -> { - p.child(UItems.PEBBLES).criterion("killed_entity_with_rock", killWithItems(UTags.FROM_ROCKS)).build(consumer, "sticks_and_stones"); + p.child(UItems.PEBBLES).criterion("killed_entity_with_rock", killWithItems(UTags.DamageTypes.FROM_ROCKS)).build(consumer, "sticks_and_stones"); p.child(UItems.WEIRD_ROCK).hidden().criterion("has_rock", hasItems(UItems.WEIRD_ROCK)).build(consumer, "thats_unusual"); }); parent.child(UItems.OATS).criterion("has_oats", hasItems(UItems.OATS)).build(consumer, "oats_so_easy"); parent.child(Items.HAY_BLOCK).criterion("eat_hay", ConsumeItemCriterion.Conditions.item(Items.HAY_BLOCK)).build(consumer, "what_the_hay"); - parent.child(UItems.COPPER_HORSE_SHOE).criterion("has_horseshoe", hasItems(UTags.HORSE_SHOES)).build(consumer, "blacksmith").children(p -> { + parent.child(UItems.COPPER_HORSE_SHOE).criterion("has_horseshoe", hasItems(UTags.Items.HORSE_SHOES)).build(consumer, "blacksmith").children(p -> { p.child(UItems.IRON_HORSE_SHOE).criterion("has_iron_horseshoe", hasItems(UItems.IRON_HORSE_SHOE)).build(consumer, "change_of_shoes") .child(UItems.GOLDEN_HORSE_SHOE).criterion("has_gold_horseshoe", hasItems(UItems.GOLDEN_HORSE_SHOE)).build(consumer, "fashionably_expensive") .child(UItems.NETHERITE_HORSE_SHOE).criterion("has_netherite_horseshoe", hasItems(UItems.NETHERITE_HORSE_SHOE)).build(consumer, "overkill"); - p.child(UItems.IRON_HORSE_SHOE).hidden().frame(AdvancementFrame.CHALLENGE).criterion("killed_entity_with_horseshoe", killWithItems(UTags.FROM_HORSESHOES)).build(consumer, "dead_ringer"); + p.child(UItems.IRON_HORSE_SHOE).hidden().frame(AdvancementFrame.CHALLENGE).criterion("killed_entity_with_horseshoe", killWithItems(UTags.DamageTypes.FROM_HORSESHOES)).build(consumer, "dead_ringer"); }); parent.child(UItems.PINECONE).frame(AdvancementFrame.CHALLENGE).criterion("eat_pinecone", ConsumeItemCriterion.Conditions.item(UItems.PINECONE)).build(consumer, "eat_pinecone"); - parent.child(UItems.OAK_BASKET).doNotAnnounce().criterion("has_basket", hasItems(UTags.BASKETS)).build(consumer, "basket_case") + parent.child(UItems.OAK_BASKET).doNotAnnounce().criterion("has_basket", hasItems(UTags.Items.BASKETS)).build(consumer, "basket_case") .child(Items.LANTERN).criterion("construct_balloon", CustomEventCriterion.create("construct_balloon")).build(consumer, "aeronaut") .child(UItems.GIANT_BALLOON).announce().frame(AdvancementFrame.CHALLENGE).criterion("ride_balloon", CustomEventCriterion.create("ride_balloon")).build(consumer, "travelling_in_style"); parent.child(UItems.MUFFIN).hidden().criterion("has_muffin", hasItems(UItems.MUFFIN)).build(consumer, "baked_bads"); parent.child(UItems.HORSE_SHOE_FRIES).criterion("has_horse_shoe_fries", hasItems(UItems.HORSE_SHOE_FRIES)).build(consumer, "lucky"); parent.child(UItems.TOAST).criterion("has_toast", hasItems(UItems.TOAST)).build(consumer, "toast") .child(UItems.BURNED_TOAST).hidden().criterion("has_burned_toast", hasItems(UItems.BURNED_TOAST)).build(consumer, "burn_toast"); - parent.child(UItems.GREEN_APPLE).criterion("has_apple", hasItems(UTags.FRESH_APPLES)).build(consumer, "apple_route").children(p -> { + parent.child(UItems.GREEN_APPLE).criterion("has_apple", hasItems(UTags.Items.FRESH_APPLES)).build(consumer, "apple_route").children(p -> { p.child(UItems.SWEET_APPLE).criterion("has_all_apples", hasItems(Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE, UItems.ROTTEN_APPLE, UItems.ZAP_APPLE, UItems.COOKED_ZAP_APPLE, Items.GOLDEN_APPLE)).build(consumer, "sweet_apple_acres"); p.child(UItems.ZAP_BULB).criterion("has_zap_apple", hasItems(UItems.ZAP_APPLE)).build(consumer, "trick_apple").children(pp -> { pp.child(UItems.ZAP_APPLE).hidden().criterion("eat_trick_apple", CustomEventCriterion.createFlying("eat_trick_apple")).build(consumer, "eat_trick_apple"); @@ -110,7 +110,7 @@ public class UAdvancementsProvider extends FabricAdvancementProvider { parent.child(Items.GLASS_PANE).criterion("break_window", CustomEventCriterion.createFlying("break_window")).rewards(AdvancementRewards.Builder.experience(10)).build(consumer, "rainbow_crash"); parent.child(UItems.PEGASUS_BADGE).criterion("fly_through_the_pain", CustomEventCriterion.createFlying("second_wind")).rewards(AdvancementRewards.Builder.experience(10)).build(consumer, "second_wind"); parent.child(UItems.EMPTY_JAR).criterion("has_empty_jar", hasItems(UItems.EMPTY_JAR)).build(consumer, "jar") - .child(UItems.RAIN_CLOUD_JAR).criterion("has_cloud_jar", hasItems(UTags.CLOUD_JARS)).rewards(AdvancementRewards.Builder.experience(55)).build(consumer, "gotcha"); + .child(UItems.RAIN_CLOUD_JAR).criterion("has_cloud_jar", hasItems(UTags.Items.CLOUD_JARS)).rewards(AdvancementRewards.Builder.experience(55)).build(consumer, "gotcha"); parent.child(UItems.LIGHTNING_JAR).frame(AdvancementFrame.CHALLENGE).criterion("lightning_strike", CustomEventCriterion.createFlying("lightning_strike")).rewards(AdvancementRewards.Builder.experience(30)).build(consumer, "mid_flight_interruption").children(p -> { p.child(UItems.LIGHTNING_JAR).hidden().frame(AdvancementFrame.CHALLENGE).apply(d -> applyLightningBugCriterions(d, RacePredicate.of(Set.of(Race.CHANGELING), Set.of()), 10, 90)).build(consumer, "lightning_bug"); p.child(UItems.LIGHTNING_JAR).hidden().frame(AdvancementFrame.CHALLENGE).apply(d -> applyLightningBugCriterions(d, RacePredicate.of(Set.of(), Set.of(Race.CHANGELING)), 10, 90)).build(consumer, "wonder_bolt"); @@ -255,7 +255,7 @@ public class UAdvancementsProvider extends FabricAdvancementProvider { static CriterionConditions dingCelestia(Set includeTribes, Set excludeTribes) { return new SendViaDragonBreathScrollCriterion.Conditions( LootContextPredicate.EMPTY, - ItemPredicate.Builder.create().tag(UTags.IS_DELIVERED_AGGRESSIVELY).build(), false, + ItemPredicate.Builder.create().tag(UTags.Items.IS_DELIVERED_AGGRESSIVELY).build(), false, Optional.of("princess celestia"), TriState.FALSE, Optional.of("dings_on_celestias_head"), diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java index 72ad8a91..266c73a7 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/loot/UChestAdditionsLootTableProvider.java @@ -39,7 +39,7 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi .rolls(UniformLootNumberProvider.create(2, 4)) .with(ItemEntry.builder(UItems.GRYPHON_FEATHER).weight(10).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, 7)))) .with(ItemEntry.builder(UItems.GOLDEN_WING).weight(1).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1, 2)))) - .with(TagEntry.expandBuilder(UTags.FRESH_APPLES).weight(1).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(2, 5)))) + .with(TagEntry.expandBuilder(UTags.Items.FRESH_APPLES).weight(1).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(2, 5)))) )); exporter.accept(LootTables.VILLAGE_FLETCHER_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(2, 4)) @@ -48,8 +48,8 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi )); exporter.accept(LootTables.VILLAGE_PLAINS_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(3, 4)) - .with(TagEntry.expandBuilder(UTags.FRESH_APPLES).weight(1)) - .with(TagEntry.expandBuilder(UTags.APPLE_SEEDS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.FRESH_APPLES).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.APPLE_SEEDS).weight(1)) )); exporter.accept(LootTables.ANCIENT_CITY_CHEST, LootTable.builder().pool(LootPool.builder() @@ -59,26 +59,26 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi exporter.accept(LootTables.BURIED_TREASURE_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) - .with(TagEntry.expandBuilder(UTags.item("food_types/shells")).weight(3)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(3)) )); exporter.accept(LootTables.SHIPWRECK_SUPPLY_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 6)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(3)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(3)) )); exporter.accept(LootTables.SHIPWRECK_TREASURE_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(3)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(3)) )); exporter.accept(LootTables.UNDERWATER_RUIN_BIG_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 2)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) .with(ItemEntry.builder(UItems.SHELLY).weight(4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(8)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(8)) )); exporter.accept(LootTables.UNDERWATER_RUIN_SMALL_CHEST, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(1)) )); exporter.accept(LootTables.DESERT_WELL_ARCHAEOLOGY, LootTable.builder().pool(LootPool.builder() @@ -89,7 +89,7 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi .with(ItemEntry.builder(UItems.ROCK_STEW).weight(1)) .with(ItemEntry.builder(UItems.PEBBLES).weight(1)) .with(ItemEntry.builder(UItems.SHELLY).weight(1)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(1)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) )); exporter.accept(LootTables.TRAIL_RUINS_COMMON_ARCHAEOLOGY, LootTable.builder().pool(LootPool.builder() @@ -106,13 +106,13 @@ public class UChestAdditionsLootTableProvider extends SimpleFabricLootTableProvi )); exporter.accept(LootTables.OCEAN_RUIN_WARM_ARCHAEOLOGY, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(1)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(1)) .with(ItemEntry.builder(UItems.PEARL_NECKLACE).weight(1)) )); exporter.accept(LootTables.FISHING_GAMEPLAY, LootTable.builder().pool(LootPool.builder() .rolls(UniformLootNumberProvider.create(1, 4)) - .with(TagEntry.expandBuilder(UTags.SHELLS).weight(2)) + .with(TagEntry.expandBuilder(UTags.Items.SHELLS).weight(2)) )); exporter.accept(LootTables.FISHING_JUNK_GAMEPLAY, LootTable.builder().pool(LootPool.builder() diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/BedSheetPatternRecipeBuilder.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/BedSheetPatternRecipeBuilder.java index 0cd69ce6..2e067830 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/BedSheetPatternRecipeBuilder.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/BedSheetPatternRecipeBuilder.java @@ -73,7 +73,7 @@ public class BedSheetPatternRecipeBuilder { private static void offerBedSheetConversionRecipe(Consumer exporter, ItemConvertible output, Stream wools) { var builder = ShapelessRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output) - .input(UTags.WOOL_BED_SHEETS).criterion("has_bed_sheet", RecipeProvider.conditionsFromTag(UTags.WOOL_BED_SHEETS)); + .input(UTags.Items.WOOL_BED_SHEETS).criterion("has_bed_sheet", RecipeProvider.conditionsFromTag(UTags.Items.WOOL_BED_SHEETS)); wools.forEach(builder::input); builder .group("bed_sheet") diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java index 3a95e32e..3e27692b 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/URecipeProvider.java @@ -80,8 +80,19 @@ public class URecipeProvider extends FabricRecipeProvider { } private void generateVanillaRecipeExtensions(Consumer exporter) { - ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, Items.WRITABLE_BOOK).input(Items.BOOK).input(Items.INK_SAC).input(UTags.MAGIC_FEATHERS).criterion("has_book", conditionsFromItem(Items.BOOK)).offerTo(exporter); - ShapedRecipeJsonBuilder.create(RecipeCategory.COMBAT, Items.ARROW, 4).input('#', UConventionalTags.STICKS).input('X', Items.FLINT).input('Y', UTags.MAGIC_FEATHERS).pattern("X").pattern("#").pattern("Y").criterion("has_feather", conditionsFromTag(UTags.MAGIC_FEATHERS)).criterion("has_flint", conditionsFromItem(Items.FLINT)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, Items.WRITABLE_BOOK) + .input(Items.BOOK).criterion("has_book", conditionsFromItem(Items.BOOK)) + .input(Items.INK_SAC) + .input(UTags.Items.MAGIC_FEATHERS) + .offerTo(exporter); + ShapedRecipeJsonBuilder.create(RecipeCategory.COMBAT, Items.ARROW, 4) + .input('#', UConventionalTags.Items.STICKS) + .input('X', Items.FLINT).criterion("has_flint", conditionsFromItem(Items.FLINT)) + .input('Y', UTags.Items.MAGIC_FEATHERS).criterion("has_feather", conditionsFromTag(UTags.Items.MAGIC_FEATHERS)) + .pattern("X") + .pattern("#") + .pattern("Y") + .offerTo(exporter); } private void offerJarRecipes(Consumer exporter) { @@ -97,7 +108,7 @@ public class URecipeProvider extends FabricRecipeProvider { } private void offerCloudRecipes(Consumer exporter) { - offerShapelessRecipe(exporter, UItems.CLOUD_LUMP, UTags.CLOUD_JARS, "cloud", 4); + offerShapelessRecipe(exporter, UItems.CLOUD_LUMP, UTags.Items.CLOUD_JARS, "cloud", 4); generateFamily(exporter, UBlockFamilies.CLOUD); offer2x3Recipe(exporter, UBlocks.CLOUD_PILLAR, UBlocks.CLOUD, "pillar"); offer2x2CompactingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, UBlocks.CLOUD, UItems.CLOUD_LUMP); @@ -200,7 +211,7 @@ public class URecipeProvider extends FabricRecipeProvider { // magic staff ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.MAGIC_STAFF) .input('*', UItems.GEMSTONE).criterion("has_gemstone", conditionsFromItem(UItems.GEMSTONE)) - .input('#', UConventionalTags.STICKS).criterion("has_stick", conditionsFromTag(UConventionalTags.STICKS)) + .input('#', UConventionalTags.Items.STICKS).criterion("has_stick", conditionsFromTag(UConventionalTags.Items.STICKS)) .pattern(" *") .pattern(" # ") .pattern("# ") @@ -217,7 +228,7 @@ public class URecipeProvider extends FabricRecipeProvider { // pegasus amulet ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.GOLDEN_FEATHER) .input('*', Items.GOLD_NUGGET).criterion("has_nugget", conditionsFromItem(Items.GOLD_NUGGET)) - .input('#', UTags.MAGIC_FEATHERS).criterion("has_feather", conditionsFromTag(UTags.MAGIC_FEATHERS)) + .input('#', UTags.Items.MAGIC_FEATHERS).criterion("has_feather", conditionsFromTag(UTags.Items.MAGIC_FEATHERS)) .pattern("***") .pattern("*#*") .pattern("***") @@ -232,7 +243,7 @@ public class URecipeProvider extends FabricRecipeProvider { // friendship bracelet ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.FRIENDSHIP_BRACELET) .input('*', Items.STRING) - .input('#', Items.LEATHER).criterion(hasItem(Items.LEATHER), conditionsFromTag(UTags.MAGIC_FEATHERS)) + .input('#', Items.LEATHER).criterion(hasItem(Items.LEATHER), conditionsFromItem(Items.LEATHER)) .pattern("*#*") .pattern("# #") .pattern("*#*") @@ -242,7 +253,7 @@ public class URecipeProvider extends FabricRecipeProvider { // meadowbrook's staff ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, UItems.MEADOWBROOKS_STAFF) .input('*', UItems.GEMSTONE).criterion(hasItem(UItems.GEMSTONE), conditionsFromItem(UItems.GEMSTONE)) - .input('/', UConventionalTags.STICKS).criterion(hasItem(Items.STICK), conditionsFromTag(UConventionalTags.STICKS)) + .input('/', UConventionalTags.Items.STICKS).criterion(hasItem(Items.STICK), conditionsFromTag(UConventionalTags.Items.STICKS)) .pattern(" *") .pattern(" / ") .pattern("/ ") @@ -310,7 +321,7 @@ public class URecipeProvider extends FabricRecipeProvider { offerShapelessRecipe(exporter, UItems.SOUR_APPLE_SEEDS, UItems.SOUR_APPLE, "seeds", 3); offerShapelessRecipe(exporter, UItems.GREEN_APPLE_SEEDS, UItems.GREEN_APPLE, "seeds", 3); offerShapelessRecipe(exporter, UItems.GOLDEN_OAK_SEEDS, Items.GOLDEN_APPLE, "seeds", 1); - offerPieRecipe(exporter, UItems.APPLE_PIE, UItems.APPLE_PIE_SLICE, Items.WHEAT, UTags.FRESH_APPLES); + offerPieRecipe(exporter, UItems.APPLE_PIE, UItems.APPLE_PIE_SLICE, Items.WHEAT, UTags.Items.FRESH_APPLES); ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.ROCK_STEW) .input(UItems.ROCK, 3).criterion(hasItem(UItems.ROCK), conditionsFromItem(UItems.ROCK)) @@ -344,20 +355,20 @@ public class URecipeProvider extends FabricRecipeProvider { .pattern("###") .offerTo(exporter, convertBetween(UItems.OATS, Items.WHEAT)); ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.JUICE) - .input(Ingredient.fromTag(UTags.FRESH_APPLES), 6).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.FRESH_APPLES)) + .input(Ingredient.fromTag(UTags.Items.FRESH_APPLES), 6).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.Items.FRESH_APPLES)) .input(Items.GLASS_BOTTLE) .group("juice") .offerTo(exporter); appendIngredients(ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.MUFFIN), Items.SUGAR, Items.EGG, Items.POTATO, UItems.JUICE, UItems.WHEAT_WORMS).offerTo(exporter); ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.MUG) .input('*', Items.IRON_NUGGET).criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET)) - .input('#', UConventionalTags.STICKS).criterion(hasItem(Items.STICK), conditionsFromTag(UConventionalTags.STICKS)) + .input('#', UConventionalTags.Items.STICKS).criterion(hasItem(Items.STICK), conditionsFromTag(UConventionalTags.Items.STICKS)) .pattern("# #") .pattern("* *") .pattern(" # ") .offerTo(exporter); appendIngredients(ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.CIDER), UItems.BURNED_JUICE, UItems.MUG) - .input(Ingredient.fromTag(UTags.FRESH_APPLES)).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.FRESH_APPLES)) + .input(Ingredient.fromTag(UTags.Items.FRESH_APPLES)).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.Items.FRESH_APPLES)) .offerTo(exporter); ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.HAY_FRIES) @@ -410,8 +421,8 @@ public class URecipeProvider extends FabricRecipeProvider { .input(UItems.TOAST, 8) .offerTo(exporter); ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, UItems.CANDIED_APPLE) - .input(UConventionalTags.STICKS) - .input(UTags.FRESH_APPLES).criterion(hasItem(UItems.ZAP_APPLE_JAM_JAR), conditionsFromItem(UItems.ZAP_APPLE_JAM_JAR)) + .input(UConventionalTags.Items.STICKS) + .input(UTags.Items.FRESH_APPLES).criterion(hasItem(Items.APPLE), conditionsFromTag(UTags.Items.FRESH_APPLES)) .input(Items.SUGAR, 4) .offerTo(exporter); @@ -445,7 +456,7 @@ public class URecipeProvider extends FabricRecipeProvider { .pattern(" C ") .offerTo(exporter); ShapedRecipeJsonBuilder.create(RecipeCategory.COMBAT, UItems.PEARL_NECKLACE) - .input('#', UTags.SHELLS).criterion("has_shell", conditionsFromTag(UTags.SHELLS)) + .input('#', UTags.Items.SHELLS).criterion("has_shell", conditionsFromTag(UTags.Items.SHELLS)) .input('~', Items.STRING) .pattern("# #") .pattern("# #") @@ -492,7 +503,7 @@ public class URecipeProvider extends FabricRecipeProvider { .pattern("#*") .offerTo(exporter, convertBetween(Items.DIRT, UItems.WHEAT_WORMS)); - offerShapelessRecipe(exporter, Items.BONE_MEAL, UTags.SHELLS, "bonemeal", 3); + offerShapelessRecipe(exporter, Items.BONE_MEAL, UTags.Items.SHELLS, "bonemeal", 3); // pegasus feathers for non pegasi ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, UItems.PEGASUS_FEATHER) @@ -578,7 +589,7 @@ public class URecipeProvider extends FabricRecipeProvider { public static void offerPolearmRecipe(Consumer exporter, ItemConvertible output, Either> input) { CraftingMaterialHelper .input(ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, output), 'o', input).criterion(CraftingMaterialHelper.hasEither(input), CraftingMaterialHelper.conditionsFromEither(input)) - .input('#', UConventionalTags.STICKS) + .input('#', UConventionalTags.Items.STICKS) .pattern(" o") .pattern(" # ") .pattern("# ") diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UBlockTagProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UBlockTagProvider.java index f4c583a4..6198be9f 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UBlockTagProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UBlockTagProvider.java @@ -44,14 +44,14 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { UBlocks.GOLDEN_OAK_SPROUT }; - getOrCreateTagBuilder(UTags.CATAPULT_IMMUNE).add(Blocks.BEDROCK).forceAddTag(BlockTags.DOORS).forceAddTag(BlockTags.TRAPDOORS); + getOrCreateTagBuilder(UTags.Blocks.CATAPULT_IMMUNE).add(Blocks.BEDROCK).forceAddTag(BlockTags.DOORS).forceAddTag(BlockTags.TRAPDOORS); getOrCreateTagBuilder(UTags.Blocks.BUTTERFLIES_SPAWNABLE_ON).forceAddTag(BlockTags.ANIMALS_SPAWNABLE_ON).forceAddTag(BlockTags.LEAVES).forceAddTag(BlockTags.FLOWERS).forceAddTag(BlockTags.FLOWER_POTS); - getOrCreateTagBuilder(UTags.JARS).add(UBlocks.JAR, UBlocks.CLOUD_JAR, UBlocks.STORM_JAR, UBlocks.LIGHTNING_JAR, UBlocks.ZAP_JAR); + getOrCreateTagBuilder(UTags.Blocks.JARS).add(UBlocks.JAR, UBlocks.CLOUD_JAR, UBlocks.STORM_JAR, UBlocks.LIGHTNING_JAR, UBlocks.ZAP_JAR); getOrCreateTagBuilder(BlockTags.CROPS).add(crops); getOrCreateTagBuilder(BlockTags.BEE_GROWABLES).add(crops); getOrCreateTagBuilder(BlockTags.MAINTAINS_FARMLAND).add(crops); getOrCreateTagBuilder(BlockTags.NEEDS_DIAMOND_TOOL).add(UBlocks.FROSTED_OBSIDIAN); - getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE).add(UBlocks.ROCKS, UBlocks.FROSTED_OBSIDIAN, UBlocks.WEATHER_VANE).forceAddTag(UTags.JARS); + getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE).add(UBlocks.ROCKS, UBlocks.FROSTED_OBSIDIAN, UBlocks.WEATHER_VANE).forceAddTag(UTags.Blocks.JARS); getOrCreateTagBuilder(BlockTags.DRAGON_IMMUNE).add(UBlocks.FROSTED_OBSIDIAN, UBlocks.GOLDEN_OAK_LOG, UBlocks.GOLDEN_OAK_LEAVES); getOrCreateTagBuilder(BlockTags.FIRE).add(UBlocks.SPECTRAL_FIRE); getOrCreateTagBuilder(BlockTags.HOE_MINEABLE).add(UBlocks.HAY_BLOCK).addOptional(Unicopia.id("rice_block")).addOptional(Unicopia.id("straw_block")); @@ -63,31 +63,31 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { addChitinBlocksets(); addFruitTrees(); - getOrCreateTagBuilder(UTags.CRYSTAL_HEART_BASE).add( + getOrCreateTagBuilder(UTags.Blocks.CRYSTAL_HEART_BASE).add( Blocks.DIAMOND_BLOCK, Blocks.QUARTZ_BLOCK, Blocks.QUARTZ_BRICKS, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_STAIRS, Blocks.QUARTZ_PILLAR, Blocks.SMOOTH_QUARTZ, Blocks.SMOOTH_QUARTZ_SLAB, Blocks.SMOOTH_QUARTZ_STAIRS, Blocks.CHISELED_QUARTZ_BLOCK, Blocks.AMETHYST_BLOCK, Blocks.NETHERITE_BLOCK, Blocks.EMERALD_BLOCK ); - getOrCreateTagBuilder(UTags.CRYSTAL_HEART_ORNAMENT).add(Blocks.END_ROD); + getOrCreateTagBuilder(UTags.Blocks.CRYSTAL_HEART_ORNAMENT).add(Blocks.END_ROD); - getOrCreateTagBuilder(UTags.FRAGILE) + getOrCreateTagBuilder(UTags.Blocks.FRAGILE) .forceAddTag(ConventionalBlockTags.GLASS_BLOCKS) .forceAddTag(ConventionalBlockTags.GLASS_PANES) - .forceAddTag(UTags.JARS) + .forceAddTag(UTags.Blocks.JARS) .add(Blocks.VINE, Blocks.LILY_PAD); - getOrCreateTagBuilder(UTags.INTERESTING).add( + getOrCreateTagBuilder(UTags.Blocks.INTERESTING).add( Blocks.SEA_LANTERN, Blocks.ENDER_CHEST, Blocks.END_PORTAL_FRAME, Blocks.JUKEBOX, Blocks.SPAWNER ).forceAddTag(ConventionalBlockTags.ORES); - getOrCreateTagBuilder(UTags.KICKS_UP_DUST).forceAddTag(BlockTags.SAND).add( + getOrCreateTagBuilder(UTags.Blocks.KICKS_UP_DUST).forceAddTag(BlockTags.SAND).add( Blocks.SUSPICIOUS_SAND, Blocks.GRAVEL, Blocks.SUSPICIOUS_GRAVEL ).forceAddTag(TagKey.of(RegistryKeys.BLOCK, new Identifier("c", "concrete_powders"))); - getOrCreateTagBuilder(UTags.UNAFFECTED_BY_GROW_ABILITY).add(Blocks.GRASS_BLOCK); + getOrCreateTagBuilder(UTags.Blocks.UNAFFECTED_BY_GROW_ABILITY).add(Blocks.GRASS_BLOCK); } private void addFruitTrees() { @@ -112,7 +112,7 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { private void addZapWoodset() { getOrCreateTagBuilder(BlockTags.LEAVES).add(UBlocks.ZAP_LEAVES, UBlocks.FLOWERING_ZAP_LEAVES); - getOrCreateTagBuilder(UTags.POLEARM_MINEABLE).add( + getOrCreateTagBuilder(UTags.Blocks.POLEARM_MINEABLE).add( UBlocks.ZAP_LEAVES, UBlocks.FLOWERING_ZAP_LEAVES, UBlocks.ZAP_PLANKS, UBlocks.ZAP_LOG, UBlocks.ZAP_WOOD, UBlocks.STRIPPED_ZAP_LOG, UBlocks.STRIPPED_ZAP_WOOD, diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UDamageTypeProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UDamageTypeProvider.java index e4170071..d0b265b1 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UDamageTypeProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UDamageTypeProvider.java @@ -19,12 +19,12 @@ public class UDamageTypeProvider extends FabricTagProvider { @Override protected void configure(WrapperLookup lookup) { - getOrCreateTagBuilder(UTags.SPELLBOOK_IMMUNE_TO).add( + getOrCreateTagBuilder(UTags.DamageTypes.SPELLBOOK_IMMUNE_TO).add( UDamageTypes.ZAP_APPLE, UDamageTypes.LOVE_DRAINING, UDamageTypes.LIFE_DRAINING, UDamageTypes.RAINBOOM, UDamageTypes.SUN, UDamageTypes.SUNLIGHT, UDamageTypes.SMASH ).forceAddTag(DamageTypeTags.IS_FALL).forceAddTag(DamageTypeTags.IS_FREEZING).forceAddTag(DamageTypeTags.IS_LIGHTNING).forceAddTag(DamageTypeTags.IS_PROJECTILE); - getOrCreateTagBuilder(UTags.FROM_ROCKS).add(UDamageTypes.ROCK); - getOrCreateTagBuilder(UTags.FROM_HORSESHOES).add(UDamageTypes.HORSESHOE); - getOrCreateTagBuilder(UTags.BREAKS_SUNGLASSES).add(UDamageTypes.BAT_SCREECH, UDamageTypes.RAINBOOM); + getOrCreateTagBuilder(UTags.DamageTypes.FROM_ROCKS).add(UDamageTypes.ROCK); + getOrCreateTagBuilder(UTags.DamageTypes.FROM_HORSESHOES).add(UDamageTypes.HORSESHOE); + getOrCreateTagBuilder(UTags.DamageTypes.BREAKS_SUNGLASSES).add(UDamageTypes.BAT_SCREECH, UDamageTypes.RAINBOOM); } } diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UItemTagProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UItemTagProvider.java index 65c5d92a..30b0c9ca 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UItemTagProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/tag/UItemTagProvider.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.datagen.providers; +package com.minelittlepony.unicopia.datagen.providers.tag; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -66,50 +66,50 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider { getOrCreateTagBuilder(ItemTags.SIGNS).add(UBlocks.PALM_SIGN.asItem()); getOrCreateTagBuilder(ItemTags.HANGING_SIGNS).add(UBlocks.PALM_HANGING_SIGN.asItem()); - getOrCreateTagBuilder(UTags.HORSE_SHOES).add(ItemFamilies.HORSE_SHOES); - getOrCreateTagBuilder(UTags.POLEARMS).add(ItemFamilies.POLEARMS); + getOrCreateTagBuilder(UTags.Items.HORSE_SHOES).add(ItemFamilies.HORSE_SHOES); + getOrCreateTagBuilder(UTags.Items.POLEARMS).add(ItemFamilies.POLEARMS); - getOrCreateTagBuilder(ItemTags.TOOLS).addTag(UTags.HORSE_SHOES).addTag(UTags.POLEARMS); + getOrCreateTagBuilder(ItemTags.TOOLS).addTag(UTags.Items.HORSE_SHOES).addTag(UTags.Items.POLEARMS); - getOrCreateTagBuilder(UTags.BASKETS).add(ItemFamilies.BASKETS); - getOrCreateTagBuilder(UTags.BADGES).add(Race.REGISTRY.stream() + getOrCreateTagBuilder(UTags.Items.BASKETS).add(ItemFamilies.BASKETS); + getOrCreateTagBuilder(UTags.Items.BADGES).add(Race.REGISTRY.stream() .map(race -> race.getId().withPath(p -> p + "_badge")) .flatMap(id -> Registries.ITEM.getOrEmpty(id).stream()) .toArray(Item[]::new)); - getOrCreateTagBuilder(UTags.WOOL_BED_SHEETS).add(BedsheetsItem.ITEMS.values().stream().filter(sheet -> sheet != UItems.KELP_BED_SHEETS).toArray(Item[]::new)); - getOrCreateTagBuilder(UTags.BED_SHEETS).forceAddTag(UTags.WOOL_BED_SHEETS).add(UItems.KELP_BED_SHEETS); - getOrCreateTagBuilder(UTags.APPLE_SEEDS).add(UItems.GREEN_APPLE_SEEDS, UItems.SWEET_APPLE_SEEDS, UItems.SOUR_APPLE_SEEDS); - getOrCreateTagBuilder(UTags.MAGIC_FEATHERS).add(UItems.PEGASUS_FEATHER, UItems.GRYPHON_FEATHER); - getOrCreateTagBuilder(UTags.FRESH_APPLES).add(Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE); - getOrCreateTagBuilder(UTags.CLOUD_JARS).add(UItems.RAIN_CLOUD_JAR, UItems.STORM_CLOUD_JAR); - getOrCreateTagBuilder(UTags.PIES).add(UItems.APPLE_PIE, UItems.APPLE_PIE_HOOF); + getOrCreateTagBuilder(UTags.Items.WOOL_BED_SHEETS).add(BedsheetsItem.ITEMS.values().stream().filter(sheet -> sheet != UItems.KELP_BED_SHEETS).toArray(Item[]::new)); + getOrCreateTagBuilder(UTags.Items.BED_SHEETS).forceAddTag(UTags.Items.WOOL_BED_SHEETS).add(UItems.KELP_BED_SHEETS); + getOrCreateTagBuilder(UTags.Items.APPLE_SEEDS).add(UItems.GREEN_APPLE_SEEDS, UItems.SWEET_APPLE_SEEDS, UItems.SOUR_APPLE_SEEDS); + getOrCreateTagBuilder(UTags.Items.MAGIC_FEATHERS).add(UItems.PEGASUS_FEATHER, UItems.GRYPHON_FEATHER); + getOrCreateTagBuilder(UTags.Items.FRESH_APPLES).add(Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE); + getOrCreateTagBuilder(UTags.Items.CLOUD_JARS).add(UItems.RAIN_CLOUD_JAR, UItems.STORM_CLOUD_JAR); + getOrCreateTagBuilder(UTags.Items.PIES).add(UItems.APPLE_PIE, UItems.APPLE_PIE_HOOF); // technical tags - getOrCreateTagBuilder(ItemTags.VILLAGER_PLANTABLE_SEEDS).addTag(UTags.APPLE_SEEDS); - getOrCreateTagBuilder(UTags.CAN_CUT_PIE).forceAddTag(ConventionalItemTags.SHEARS).addOptionalTag(UConventionalTags.TOOL_KNIVES); - getOrCreateTagBuilder(UTags.COOLS_OFF_KIRINS).add(Items.MELON_SLICE, UItems.JUICE).forceAddTag(ConventionalItemTags.WATER_BUCKETS); - getOrCreateTagBuilder(UTags.FALLS_SLOWLY).add(Items.FEATHER, UItems.CLOUD_LUMP).forceAddTag(UTags.MAGIC_FEATHERS); - getOrCreateTagBuilder(UTags.IS_DELIVERED_AGGRESSIVELY).forceAddTag(ItemTags.ANVIL); - getOrCreateTagBuilder(UTags.SPOOKED_MOB_DROPS).add(Items.BRICK); - getOrCreateTagBuilder(UTags.SHADES).add( + getOrCreateTagBuilder(ItemTags.VILLAGER_PLANTABLE_SEEDS).addTag(UTags.Items.APPLE_SEEDS); + getOrCreateTagBuilder(UTags.Items.CAN_CUT_PIE).forceAddTag(ConventionalItemTags.SHEARS).addOptionalTag(UConventionalTags.Items.TOOL_KNIVES); + getOrCreateTagBuilder(UTags.Items.COOLS_OFF_KIRINS).add(Items.MELON_SLICE, UItems.JUICE).forceAddTag(ConventionalItemTags.WATER_BUCKETS); + getOrCreateTagBuilder(UTags.Items.FALLS_SLOWLY).add(Items.FEATHER, UItems.CLOUD_LUMP).forceAddTag(UTags.Items.MAGIC_FEATHERS); + getOrCreateTagBuilder(UTags.Items.IS_DELIVERED_AGGRESSIVELY).forceAddTag(ItemTags.ANVIL); + getOrCreateTagBuilder(UTags.Items.SPOOKED_MOB_DROPS).add(Items.BRICK); + getOrCreateTagBuilder(UTags.Items.SHADES).add( Items.CARVED_PUMPKIN, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL, Items.PLAYER_HEAD, Items.ZOMBIE_HEAD, Items.CREEPER_HEAD, Items.DRAGON_HEAD, Items.PIGLIN_HEAD, UItems.SUNGLASSES ); - getOrCreateTagBuilder(UTags.FLOATS_ON_CLOUDS) + getOrCreateTagBuilder(UTags.Items.FLOATS_ON_CLOUDS) .forceAddTag(UTags.Items.CLOUD_BEDS) .forceAddTag(UTags.Items.CLOUD_SLABS) .forceAddTag(UTags.Items.CLOUD_STAIRS) .forceAddTag(UTags.Items.CLOUD_BLOCKS) .add(UItems.CLOUD_LUMP); - getOrCreateTagBuilder(UTags.HAS_NO_TRAITS).add( + getOrCreateTagBuilder(UTags.Items.HAS_NO_TRAITS).add( Items.AIR, Items.SPAWNER, Items.STRUCTURE_VOID, Items.STRUCTURE_BLOCK, Items.COMMAND_BLOCK, Items.CHAIN_COMMAND_BLOCK, Items.REPEATING_COMMAND_BLOCK, Items.LIGHT, Items.JIGSAW, Items.BARRIER, Items.BEDROCK, Items.END_PORTAL_FRAME, Items.DEBUG_STICK, Items.COMMAND_BLOCK_MINECART, UItems.PLUNDER_VINE - ).forceAddTag(UTags.BADGES); - getOrCreateTagBuilder(UTags.LOOT_BUG_HIGH_VALUE_DROPS).add( + ).forceAddTag(UTags.Items.BADGES); + getOrCreateTagBuilder(UTags.Items.LOOT_BUG_HIGH_VALUE_DROPS).add( Items.DIAMOND, Items.GOLDEN_APPLE, Items.GOLDEN_CARROT, Items.GOLDEN_HELMET, Items.GOLDEN_BOOTS, Items.GOLDEN_LEGGINGS, Items.GOLDEN_CHESTPLATE, Items.GOLDEN_HORSE_ARMOR, @@ -152,36 +152,38 @@ public class UItemTagProvider extends FabricTagProvider.ItemTagProvider { } private void exportConventionalTags() { - getOrCreateTagBuilder(UConventionalTags.ACORNS).add(UItems.ACORN); - getOrCreateTagBuilder(UConventionalTags.APPLES) + copy(UConventionalTags.Blocks.CONCRETES, UConventionalTags.Items.CONCRETES); + copy(UConventionalTags.Blocks.CONCRETE_POWDERS, UConventionalTags.Items.CONCRETE_POWDERS); + getOrCreateTagBuilder(UConventionalTags.Items.ACORNS).add(UItems.ACORN); + getOrCreateTagBuilder(UConventionalTags.Items.APPLES) .add(Items.APPLE, Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE, UItems.ROTTEN_APPLE) - .forceAddTag(UTags.FRESH_APPLES) + .forceAddTag(UTags.Items.FRESH_APPLES) .addOptionalTag(new Identifier("c", "pyrite_apples")) // no idea which mod add pyrite apples ; - getOrCreateTagBuilder(UConventionalTags.BANANAS).add(UItems.BANANA); - getOrCreateTagBuilder(UConventionalTags.COOKED_FISH).add(Items.COOKED_COD, Items.COOKED_SALMON); - getOrCreateTagBuilder(UConventionalTags.STICKS).add(Items.STICK); - getOrCreateTagBuilder(UConventionalTags.PINECONES).add(UItems.PINECONE); - getOrCreateTagBuilder(UConventionalTags.PINEAPPLES).add(UItems.PINEAPPLE); - getOrCreateTagBuilder(UConventionalTags.MANGOES).add(UItems.MANGO); - getOrCreateTagBuilder(UConventionalTags.MUSHROOMS).add(Items.RED_MUSHROOM, Items.BROWN_MUSHROOM); - getOrCreateTagBuilder(UConventionalTags.MUFFINS).add(UItems.MUFFIN); - getOrCreateTagBuilder(UConventionalTags.SEEDS).add(Items.BEETROOT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.TORCHFLOWER_SEEDS, Items.WHEAT_SEEDS) + getOrCreateTagBuilder(UConventionalTags.Items.BANANAS).add(UItems.BANANA); + getOrCreateTagBuilder(UConventionalTags.Items.COOKED_FISH).add(Items.COOKED_COD, Items.COOKED_SALMON); + getOrCreateTagBuilder(UConventionalTags.Items.STICKS).add(Items.STICK); + getOrCreateTagBuilder(UConventionalTags.Items.PINECONES).add(UItems.PINECONE); + getOrCreateTagBuilder(UConventionalTags.Items.PINEAPPLES).add(UItems.PINEAPPLE); + getOrCreateTagBuilder(UConventionalTags.Items.MANGOES).add(UItems.MANGO); + getOrCreateTagBuilder(UConventionalTags.Items.MUSHROOMS).add(Items.RED_MUSHROOM, Items.BROWN_MUSHROOM); + getOrCreateTagBuilder(UConventionalTags.Items.MUFFINS).add(UItems.MUFFIN); + getOrCreateTagBuilder(UConventionalTags.Items.SEEDS).add(Items.BEETROOT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.TORCHFLOWER_SEEDS, Items.WHEAT_SEEDS) .add(UItems.OAT_SEEDS) - .forceAddTag(UTags.APPLE_SEEDS); - getOrCreateTagBuilder(UConventionalTags.OATMEALS).add(UItems.OATMEAL); - getOrCreateTagBuilder(UConventionalTags.GRAIN).add(Items.WHEAT, UItems.OATS); - getOrCreateTagBuilder(UConventionalTags.NUTS).addOptionalTag(UConventionalTags.CROPS_PEANUTS); + .forceAddTag(UTags.Items.APPLE_SEEDS); + getOrCreateTagBuilder(UConventionalTags.Items.OATMEALS).add(UItems.OATMEAL); + getOrCreateTagBuilder(UConventionalTags.Items.GRAIN).add(Items.WHEAT, UItems.OATS); + getOrCreateTagBuilder(UConventionalTags.Items.NUTS).addOptionalTag(UConventionalTags.Items.CROPS_PEANUTS); - getOrCreateTagBuilder(UConventionalTags.FRUITS) - .forceAddTag(UConventionalTags.MANGOES) - .forceAddTag(UConventionalTags.PINEAPPLES) - .forceAddTag(UConventionalTags.APPLES) - .forceAddTag(UConventionalTags.BANANAS); + getOrCreateTagBuilder(UConventionalTags.Items.FRUITS) + .forceAddTag(UConventionalTags.Items.MANGOES) + .forceAddTag(UConventionalTags.Items.PINEAPPLES) + .forceAddTag(UConventionalTags.Items.APPLES) + .forceAddTag(UConventionalTags.Items.BANANAS); } private void exportFarmersDelightItems() { - getOrCreateTagBuilder(UTags.COOLS_OFF_KIRINS) + getOrCreateTagBuilder(UTags.Items.COOLS_OFF_KIRINS) .addOptional(new Identifier("farmersdelight:melon_popsicle")) .addOptional(new Identifier("farmersdelight:melon_juice")); getOrCreateTagBuilder(TagKey.of(RegistryKeys.ITEM, new Identifier("farmersdelight:cabbage_roll_ingredients"))).add(UItems.OATS, UItems.ROCK, UItems.WHEAT_WORMS); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java b/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java index 59d84ddb..27e8ca7f 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java @@ -111,7 +111,7 @@ public class ItemImpl implements Equine { }); } - if (stack.isIn(UTags.FALLS_SLOWLY)) { + if (stack.isIn(UTags.Items.FALLS_SLOWLY)) { if (!entity.isOnGround() && Math.signum(entity.getVelocity().y) != getPhysics().getGravitySignum()) { double ticks = ((Entity)entity).age; double shift = Math.sin(ticks / 9D) / 9D; @@ -160,7 +160,7 @@ public class ItemImpl implements Equine { @Override public boolean collidesWithClouds() { - return entity.getStack().isIn(UTags.FLOATS_ON_CLOUDS) || getSpecies().hasPersistentWeatherMagic(); + return entity.getStack().isIn(UTags.Items.FLOATS_ON_CLOUDS) || getSpecies().hasPersistentWeatherMagic(); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index fecfe073..1696abef 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -310,7 +310,7 @@ public abstract class Living implements Equine, Caste ItemStack payload = stack.payload(); Item item = payload.getItem(); - boolean deliverAggressively = payload.isIn(UTags.IS_DELIVERED_AGGRESSIVELY); + boolean deliverAggressively = payload.isIn(UTags.Items.IS_DELIVERED_AGGRESSIVELY); Vec3d randomPos = deliverAggressively ? targetPos.add(0, 2, 0) : targetPos.add(VecHelper.supply(() -> entity.getRandom().nextTriangular(0.1, 0.5))); @@ -400,7 +400,7 @@ public abstract class Living implements Equine, Caste this.attacker = attacker; } - if (magical.isIn(UTags.BREAKS_SUNGLASSES)) { + if (magical.isIn(UTags.DamageTypes.BREAKS_SUNGLASSES)) { ItemStack glasses = GlassesItem.getForEntity(entity); if (glasses.getItem() == UItems.SUNGLASSES) { ItemStack broken = UItems.BROKEN_SUNGLASSES.getDefaultStack(); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java b/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java index c9f679c6..10e607a9 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/effect/SunBlindnessStatusEffect.java @@ -72,8 +72,8 @@ public class SunBlindnessStatusEffect extends StatusEffect { return true; } - if (entity.getEquippedStack(EquipmentSlot.HEAD).isIn(UTags.SHADES) - || TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(i -> i.isIn(UTags.SHADES)) + if (entity.getEquippedStack(EquipmentSlot.HEAD).isIn(UTags.Items.SHADES) + || TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(i -> i.isIn(UTags.Items.SHADES)) || entity.isSubmergedInWater()) { return false; } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java index da18363f..5808aea4 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/SpellbookEntity.java @@ -373,7 +373,7 @@ public class SpellbookEntity extends MobEntity implements MagicImmune { @Override public boolean isInvulnerableTo(DamageSource damageSource) { - return super.isInvulnerableTo(damageSource) || damageSource.isIn(UTags.SPELLBOOK_IMMUNE_TO); + return super.isInvulnerableTo(damageSource) || damageSource.isIn(UTags.DamageTypes.SPELLBOOK_IMMUNE_TO); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java index ff73a2f8..74e38429 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/UTradeOffers.java @@ -35,7 +35,7 @@ public interface UTradeOffers { factories.add(buyForEmeralds(UItems.GEMSTONE, 3, 1, 20, 1, 0.05F)); }); 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, 4, UTags.Items.APPLE_SEEDS, 2, 20, 1, 0.05F)); factories.add(buy(Items.EMERALD, 8, UItems.MANGO, 1, 15, 1, 0.025F)); }); @@ -47,7 +47,7 @@ public interface UTradeOffers { factories.add(buy(ItemTags.SMALL_FLOWERS, 2, UItems.DAFFODIL_DAISY_SANDWICH, 1, 10, 6, 0.08F)); 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(UItems.GEMSTONE, 5, UTags.Items.FRESH_APPLES, 2, 12, 3, 0.05F)); factories.add(buy(Items.EMERALD, 4, UItems.MANGO, 1, 35, 1, 0.025F)); factories.add(new JarredItemTradeOfferFactory()); }); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index b4db56d0..fc53f9b0 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -194,7 +194,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab private FlightType recalculateFlightType() { DimensionType dimension = entity.getWorld().getDimension(); - if ((RegistryUtils.isIn(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE, UTags.HAS_NO_ATMOSPHERE) + if ((RegistryUtils.isIn(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE, UTags.DimensionTypes.HAS_NO_ATMOSPHERE) || Unicopia.getConfig().dimensionsWithoutAtmosphere.get().contains(RegistryUtils.getId(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE).toString())) && !OxygenUtils.API.hasOxygen(entity)) { return FlightType.NONE; @@ -582,7 +582,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab if (entity.isOnGround() || !force) { BlockState steppingState = pony.asEntity().getSteppingBlockState(); - if (steppingState.isIn(UTags.KICKS_UP_DUST)) { + if (steppingState.isIn(UTags.Blocks.KICKS_UP_DUST)) { pony.addParticle(new BlockStateParticleEffect(UParticles.DUST_CLOUD, steppingState), pony.getOrigin().toCenterPos(), Vec3d.ZERO); } else { Supplier pos = VecHelper.sphere(pony.asWorld().getRandom(), 0.5D); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index 10efd22d..fad4a95d 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -551,7 +551,7 @@ public class Pony extends Living implements Copyable, Update } if (getObservedSpecies() == Race.BAT && !entity.hasPortalCooldown()) { - boolean hasShades = TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(s -> s.isIn(UTags.SHADES)); + boolean hasShades = TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.FACE).anyMatch(s -> s.isIn(UTags.Items.SHADES)); if (!this.hasShades && hasShades && getObservedSpecies() == Race.BAT) { UCriteria.WEAR_SHADES.trigger(entity); } @@ -754,7 +754,7 @@ public class Pony extends Living implements Copyable, Update } if (getObservedSpecies() == Race.KIRIN - && (stack.isIn(UTags.COOLS_OFF_KIRINS) || PotionUtil.getPotion(stack) == Potions.WATER)) { + && (stack.isIn(UTags.Items.COOLS_OFF_KIRINS) || PotionUtil.getPotion(stack) == Potions.WATER)) { getMagicalReserves().getCharge().multiply(0.5F); getSpellSlot().get(SpellType.RAGE, false).ifPresent(RageAbilitySpell::setExtenguishing); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java b/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java index d4f9607c..c334124f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/CrystalHeartItem.java @@ -188,7 +188,7 @@ public class CrystalHeartItem extends Item implements FloatingArtefactEntity.Art BlockPos tip = entity.getBlockPos().offset(direction); BlockState tipState = entity.getWorld().getBlockState(tip); - if (!tipState.isIn(UTags.CRYSTAL_HEART_ORNAMENT) || (!tipState.contains(EndRodBlock.FACING)|| tipState.get(EndRodBlock.FACING) != direction.getOpposite())) { + if (!tipState.isIn(UTags.Blocks.CRYSTAL_HEART_ORNAMENT) || (!tipState.contains(EndRodBlock.FACING)|| tipState.get(EndRodBlock.FACING) != direction.getOpposite())) { return false; } @@ -207,6 +207,6 @@ public class CrystalHeartItem extends Item implements FloatingArtefactEntity.Art } private boolean isDiamond(BlockState state) { - return state.isIn(UTags.CRYSTAL_HEART_BASE); + return state.isIn(UTags.Blocks.CRYSTAL_HEART_BASE); } } diff --git a/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java b/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java index 7098e7a4..9ff3941f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java @@ -29,7 +29,7 @@ public class PineappleItem extends Item { }); if (world.random.nextInt(20) == 0) { - RegistryUtils.pickRandom(world, UTags.PINEAPPLE_EFFECTS, e -> !user.hasStatusEffect(e)).ifPresent(effect -> { + RegistryUtils.pickRandom(world, UTags.StatusEffects.PINEAPPLE_EFFECTS, e -> !user.hasStatusEffect(e)).ifPresent(effect -> { user.addStatusEffect(new StatusEffectInstance(effect, 10, 1)); }); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java b/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java index a7f430c4..5dc90908 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/PolearmItem.java @@ -41,7 +41,7 @@ public class PolearmItem extends SwordItem { @Override public boolean isSuitableFor(BlockState state) { - return state.isIn(UTags.POLEARM_MINEABLE); + return state.isIn(UTags.Blocks.POLEARM_MINEABLE); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index be2973db..30ff595f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -272,7 +272,7 @@ public interface UItems { FuelRegistry.INSTANCE.add(SPELLBOOK, 9000); FuelRegistry.INSTANCE.add(MEADOWBROOKS_STAFF, 800); FuelRegistry.INSTANCE.add(BURNED_TOAST, 1600); - FuelRegistry.INSTANCE.add(UTags.BASKETS, 1700); + FuelRegistry.INSTANCE.add(UTags.Items.BASKETS, 1700); CompostingChanceRegistry.INSTANCE.add(GREEN_APPLE, 0.65F); CompostingChanceRegistry.INSTANCE.add(SWEET_APPLE, 0.65F); diff --git a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java b/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java index 63cfb026..f8fe1ee3 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/ZapAppleItem.java @@ -103,7 +103,7 @@ public class ZapAppleItem extends Item implements ChameleonItem, MultiItem { public List getDefaultStacks() { return Unicopia.SIDE.getPony().map(Pony::asWorld) .stream() - .flatMap(world -> RegistryUtils.valuesForTag(world, UConventionalTags.APPLES)) + .flatMap(world -> RegistryUtils.valuesForTag(world, UConventionalTags.Items.APPLES)) .filter(a -> a != this).map(item -> { ItemStack stack = new ItemStack(this); stack.getOrCreateNbt().putString("appearance", Registries.ITEM.getId(item).toString()); diff --git a/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java b/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java index 0010a097..d07383cc 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java +++ b/src/main/java/com/minelittlepony/unicopia/item/enchantment/GemFindingEnchantment.java @@ -21,7 +21,7 @@ public class GemFindingEnchantment extends SimpleEnchantment { BlockPos origin = user.getOrigin(); - double volume = BlockPos.findClosest(origin, radius, radius, pos -> user.asWorld().getBlockState(pos).isIn(UTags.INTERESTING)) + double volume = BlockPos.findClosest(origin, radius, radius, pos -> user.asWorld().getBlockState(pos).isIn(UTags.Blocks.INTERESTING)) .map(p -> user.getOriginVector().squaredDistanceTo(p.getX(), p.getY(), p.getZ())) .map(find -> (1 - (Math.sqrt(find) / radius))) .orElse(-1D); diff --git a/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java b/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java index 3998f13b..c276d2c6 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java +++ b/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java @@ -4,7 +4,6 @@ import java.util.*; import java.util.function.Supplier; import java.util.stream.Stream; -import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.Unicopia; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; @@ -57,10 +56,9 @@ public interface ItemGroupRegistry { return key; } - static RegistryKey createGroupFromTag(String name, Supplier icon) { - TagKey key = UTags.item("groups/" + name); + static RegistryKey createGroupFromTag(String name, TagKey tag, Supplier icon) { return createDynamic(name, icon, () -> { - return Registries.ITEM.getEntryList(key) + return Registries.ITEM.getEntryList(tag) .stream() .flatMap(named -> named.stream()) .map(entry -> entry.value()); diff --git a/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java b/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java index a1f0efae..a479fa90 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java +++ b/src/main/java/com/minelittlepony/unicopia/item/group/UItemGroups.java @@ -2,6 +2,7 @@ package com.minelittlepony.unicopia.item.group; import java.util.stream.Stream; +import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.item.ChameleonItem; import com.minelittlepony.unicopia.item.UItems; import net.minecraft.item.*; @@ -12,13 +13,13 @@ public interface UItemGroups { return Stream.concat(Stream.of(Items.APPLE), ItemGroupRegistry.ITEMS.stream() .filter(item -> !(item instanceof ChameleonItem) || ((ChameleonItem)item).isFullyDisguised())); }); - RegistryKey FORAGING_ITEMS = ItemGroupRegistry.createGroupFromTag("foraging", Items.HAY_BLOCK::getDefaultStack); - RegistryKey EARTH_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("earth_pony", UItems.EARTH_BADGE::getDefaultStack); - RegistryKey UNICORN_ITEMS = ItemGroupRegistry.createGroupFromTag("unicorn", UItems.UNICORN_BADGE::getDefaultStack); - RegistryKey PEGASUS_ITEMS = ItemGroupRegistry.createGroupFromTag("pegasus", UItems.PEGASUS_BADGE::getDefaultStack); - RegistryKey BAT_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("bat_pony", UItems.BAT_BADGE::getDefaultStack); - RegistryKey SEA_PON_ITEMS = ItemGroupRegistry.createGroupFromTag("sea_pony", UItems.PEARL_NECKLACE::getDefaultStack); - RegistryKey CHANGELING_ITEMS = ItemGroupRegistry.createGroupFromTag("changeling", UItems.CHANGELING_BADGE::getDefaultStack); + RegistryKey FORAGING_ITEMS = ItemGroupRegistry.createGroupFromTag("foraging", UTags.Items.GROUP_FORAGING, Items.HAY_BLOCK::getDefaultStack); + RegistryKey EARTH_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("earth_pony", UTags.Items.GROUP_EARTH_PONY, UItems.EARTH_BADGE::getDefaultStack); + RegistryKey UNICORN_ITEMS = ItemGroupRegistry.createGroupFromTag("unicorn", UTags.Items.GROUP_UNICORN, UItems.UNICORN_BADGE::getDefaultStack); + RegistryKey PEGASUS_ITEMS = ItemGroupRegistry.createGroupFromTag("pegasus", UTags.Items.GROUP_PEGASUS, UItems.PEGASUS_BADGE::getDefaultStack); + RegistryKey BAT_PONY_ITEMS = ItemGroupRegistry.createGroupFromTag("bat_pony", UTags.Items.GROUP_BAT_PONY, UItems.BAT_BADGE::getDefaultStack); + RegistryKey SEA_PON_ITEMS = ItemGroupRegistry.createGroupFromTag("sea_pony", UTags.Items.GROUP_SEA_PONY, UItems.PEARL_NECKLACE::getDefaultStack); + RegistryKey CHANGELING_ITEMS = ItemGroupRegistry.createGroupFromTag("changeling", UTags.Items.GROUP_CHANGELING, UItems.CHANGELING_BADGE::getDefaultStack); static void bootstrap() { ItemGroupRegistry.bootstrap(); diff --git a/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java index 531f670e..de74181e 100644 --- a/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java @@ -145,7 +145,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl return; } else { ItemStack stack = asItemStack(); - if (stack.isIn(UTags.HORSE_SHOES)) { + if (stack.isIn(UTags.Items.HORSE_SHOES)) { if (stack.damage(1 + random.nextInt(10), random, null)) { playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1); } else { @@ -205,7 +205,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl boolean ownerCanModify = !getWorld().isClient && Caster.of(getOwner()).filter(pony -> pony.canModifyAt(hit.getBlockPos())).isPresent(); if (ownerCanModify && getWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) { - if ((!isBouncy() || getWorld().random.nextInt(200) == 0) && state.isIn(UTags.FRAGILE)) { + if ((!isBouncy() || getWorld().random.nextInt(200) == 0) && state.isIn(UTags.Blocks.FRAGILE)) { getWorld().breakBlock(hit.getBlockPos(), true); } } @@ -246,7 +246,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl emitGameEvent(GameEvent.STEP); if (!isBouncy()) { - if (stack.isIn(UTags.HORSE_SHOES)) { + if (stack.isIn(UTags.Items.HORSE_SHOES)) { if (stack.damage(1 + random.nextInt(10), random, null)) { playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1); discard(); @@ -262,7 +262,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl @Override protected SoundEvent getHitSound() { - if (getStack().isIn(UTags.HORSE_SHOES)) { + if (getStack().isIn(UTags.Items.HORSE_SHOES)) { return USounds.Vanilla.ITEM_TRIDENT_HIT_GROUND; } return isBouncy() ? USounds.ITEM_MUFFIN_BOUNCE.value() : USounds.ITEM_ROCK_LAND;