diff --git a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/advancement/AntarchyAdvancementTriggers.java b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/advancement/AntarchyAdvancementTriggers.java new file mode 100644 index 00000000..59f6e83e --- /dev/null +++ b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/advancement/AntarchyAdvancementTriggers.java @@ -0,0 +1,92 @@ +package com.craisinlord.antarchy.content.advancement; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import java.util.Optional; +import java.util.function.BiConsumer; +import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.advancements.CriterionTrigger; +import net.minecraft.advancements.critereon.ContextAwarePredicate; +import net.minecraft.advancements.critereon.SimpleCriterionTrigger; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerPlayer; + +public final class AntarchyAdvancementTriggers { + private static final EventInstance EMPTY = new EventInstance(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + private static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + ContextAwarePredicate.CODEC.optionalFieldOf("player").forGetter(EventInstance::player), + Codec.STRING.optionalFieldOf("direction").forGetter(EventInstance::direction), + Codec.STRING.optionalFieldOf("phase").forGetter(EventInstance::phase), + Codec.STRING.optionalFieldOf("variant").forGetter(EventInstance::variant) + ).apply(instance, EventInstance::new)); + private static final CrossedGravityThroat CROSSING = new CrossedGravityThroat(); + private static final HordePhaseChanged HORDE_PHASE = new HordePhaseChanged(); + private static final TamedGlimmer TAMED_GLIMMER = new TamedGlimmer(); + + private AntarchyAdvancementTriggers() { + } + + public static void register() { + register((id, trigger) -> CriteriaTriggers.register(id.toString(), trigger)); + } + + /** + * Registers these triggers through the active loader's lifecycle hook. + * NeoForge calls this from its trigger-type RegisterEvent; Fabric can call + * the no-argument overload during its initializer. + */ + public static void register(BiConsumer> registrar) { + registrar.accept(ResourceLocation.fromNamespaceAndPath("antarchy", "crossed_gravity_throat"), CROSSING); + registrar.accept(ResourceLocation.fromNamespaceAndPath("antarchy", "horde_phase_changed"), HORDE_PHASE); + registrar.accept(ResourceLocation.fromNamespaceAndPath("antarchy", "tamed_glimmer"), TAMED_GLIMMER); + } + + public static void crossedGravityThroat(ServerPlayer player, String direction) { + CROSSING.fire(player, direction); + } + + public static void hordePhaseChanged(ServerPlayer player, String phase) { + HORDE_PHASE.fire(player, phase); + } + + public static void tamedGlimmer(ServerPlayer player, String variant) { + TAMED_GLIMMER.fire(player, variant); + } + + private record EventInstance(Optional player, Optional direction, Optional phase, Optional variant) + implements SimpleCriterionTrigger.SimpleInstance { + } + + private static final class CrossedGravityThroat extends SimpleCriterionTrigger { + private void fire(ServerPlayer player, String direction) { + trigger(player, instance -> instance.direction().map(direction::equals).orElse(true)); + } + + @Override + public Codec codec() { + return CODEC; + } + } + + private static final class HordePhaseChanged extends SimpleCriterionTrigger { + private void fire(ServerPlayer player, String phase) { + trigger(player, instance -> instance.phase().map(phase::equals).orElse(true)); + } + + @Override + public Codec codec() { + return CODEC; + } + } + + private static final class TamedGlimmer extends SimpleCriterionTrigger { + private void fire(ServerPlayer player, String variant) { + trigger(player, instance -> instance.variant().map(variant::equals).orElse(true)); + } + + @Override + public Codec codec() { + return CODEC; + } + } +} diff --git a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java index e9911fa6..9c35ac44 100644 --- a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java +++ b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java @@ -3,6 +3,7 @@ package com.craisinlord.antarchy.content.entity.glimmer; import com.craisinlord.antarchy.config.AntarchySettings; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.advancement.AntarchyAdvancements; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancementTriggers; import com.craisinlord.antarchy.content.client.particle.GlimmerParticles; import com.craisinlord.antarchy.content.entity.ConfiguredMobSpawnUtil; import com.craisinlord.antarchy.Antarchy; @@ -435,6 +436,7 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer) { AntarchyAdvancements.award(serverPlayer, this.getVariant().tameAdvancementId()); + AntarchyAdvancementTriggers.tamedGlimmer(serverPlayer, this.getVariant().name().toLowerCase(java.util.Locale.ROOT)); } return InteractionResult.SUCCESS; diff --git a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java index 7909b836..6f98e9e1 100644 --- a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java +++ b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java @@ -4,6 +4,7 @@ import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.AntarchyGameRules; import com.craisinlord.antarchy.content.AntarchySoundEvents; import com.craisinlord.antarchy.content.AntarchyTags; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancementTriggers; import com.craisinlord.antarchy.content.entity.JerryEntity; import com.craisinlord.antarchy.content.network.HerculesBeetleImpactShakeSync; import com.craisinlord.antarchy.content.network.HordeIntensitySync; @@ -340,6 +341,11 @@ public final class CavarynHordeManager { data.setDirty(); } if (encounter.phase == Phase.HERCULES && herculesCleared(level, encounter, gameTime)) { + if (herculesDefeated(level, encounter)) { + for (ServerPlayer player : targetsFor(level, encounter)) { + AntarchyAdvancementTriggers.hordePhaseChanged(player, "completed"); + } + } encounter.phase = Phase.RECOVERY; encounter.recoveryEndsAt = gameTime + RECOVERY_TICKS; data.setDirty(); @@ -387,6 +393,19 @@ public final class CavarynHordeManager { return true; } + private static boolean herculesDefeated(ServerLevel level, Encounter encounter) { + if (encounter.herculesIds.isEmpty()) { + return false; + } + for (UUID uuid : encounter.herculesIds) { + Entity entity = level.getEntity(uuid); + if (entity instanceof LivingEntity living && living.isAlive() && !living.isRemoved()) { + return false; + } + } + return true; + } + private static void addAttention(ServerLevel level, ServerPlayer player, int amount) { HordeData data = get(level); PlayerAttention attention = data.players.computeIfAbsent(player.getUUID(), ignored -> new PlayerAttention()); @@ -429,6 +448,9 @@ public final class CavarynHordeManager { } data.encounters.add(encounter); data.setDirty(); + for (ServerPlayer player : targetsFor(level, encounter)) { + AntarchyAdvancementTriggers.hordePhaseChanged(player, "awakening"); + } } private static List buildTargetedSpawnList(ServerLevel level, ResourceLocation horde, List targets, int players, boolean highAttention) { diff --git a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java index 645e5cbf..e9a96bbd 100644 --- a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java +++ b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.item; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.advancement.AntarchyAdvancements; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancementTriggers; import com.craisinlord.antarchy.content.client.particle.GlimmerParticles; import com.craisinlord.antarchy.content.entity.glimmer.GlimmerCompanionSavedData; import com.craisinlord.antarchy.content.entity.glimmer.GlimmerEntity; @@ -99,6 +100,7 @@ public class GlimmerBottleItem extends Item { if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer) { AntarchyAdvancements.award(serverPlayer, variant.tameAdvancementId()); + AntarchyAdvancementTriggers.tamedGlimmer(serverPlayer, variant.name().toLowerCase(java.util.Locale.ROOT)); } ItemStack result = ItemUtils.createFilledResult(stack, player, new ItemStack(Items.GLASS_BOTTLE)); diff --git a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/portalgun/PortalGunSavedData.java b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/portalgun/PortalGunSavedData.java index b94135f8..70b59cfc 100644 --- a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/portalgun/PortalGunSavedData.java +++ b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/portalgun/PortalGunSavedData.java @@ -1,5 +1,6 @@ package com.craisinlord.antarchy.content.portalgun; +import com.craisinlord.antarchy.content.item.PortalGunItem; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -12,7 +13,9 @@ import net.minecraft.nbt.ListTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.saveddata.SavedData; public final class PortalGunSavedData extends SavedData { @@ -167,6 +170,50 @@ public final class PortalGunSavedData extends SavedData { return clearMatching(server, record -> record.ownerId() != null && ownerIds.contains(record.ownerId())); } + /** Clears portal pairs for guns that an owner no longer has in their player inventory. */ + public static int clearMissingGuns(ServerPlayer player) { + PortalGunSavedData data = get(player.serverLevel().getServer()); + if (data.pairs.isEmpty()) { + return 0; + } + + Set heldGunIds = new HashSet<>(); + collectGunIds(player.getInventory().items, heldGunIds); + collectGunIds(player.getInventory().armor, heldGunIds); + collectGunIds(player.getInventory().offhand, heldGunIds); + + UUID ownerId = player.getUUID(); + Set removedPortalIds = new HashSet<>(); + Set missingGunIds = new HashSet<>(); + boolean removed = data.pairs.entrySet().removeIf(entry -> { + PairRecord record = entry.getValue(); + if (!ownerId.equals(record.ownerId()) || heldGunIds.contains(entry.getKey().gunId())) { + return false; + } + missingGunIds.add(entry.getKey().gunId()); + addPortalIds(removedPortalIds, record); + return true; + }); + if (removed) { + data.setDirty(); + } + for (UUID portalId : removedPortalIds) { + discardIfLoaded(player.serverLevel().getServer(), portalId); + } + return missingGunIds.size(); + } + + private static void collectGunIds(Iterable stacks, Set gunIds) { + for (ItemStack stack : stacks) { + if (stack.getItem() instanceof PortalGunItem) { + UUID gunId = PortalGunItem.getGunId(stack); + if (gunId != null) { + gunIds.add(gunId); + } + } + } + } + public static int clearEverything(MinecraftServer server) { return clearMatching(server, record -> true); } diff --git a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/worldgen/thoraxis/ThoraxisUndersideManager.java b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/worldgen/thoraxis/ThoraxisUndersideManager.java index 2d0ad520..c20fbf38 100644 --- a/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/worldgen/thoraxis/ThoraxisUndersideManager.java +++ b/common-1.21.1/src/main/java/com/craisinlord/antarchy/content/worldgen/thoraxis/ThoraxisUndersideManager.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.worldgen.thoraxis; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.AntarchyObjects; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancementTriggers; import com.craisinlord.antarchy.content.block.DreamSandBlock; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection; @@ -288,6 +289,7 @@ public final class ThoraxisUndersideManager { tracking.lastFlipTick.put(player.getUUID(), now); if (crossing.toUnderside) { refreshInvertedEffect(player); + AntarchyAdvancementTriggers.crossedGravityThroat(player, "down"); } else { player.removeEffect(AntarchyObjects.INVERTED_EFFECT.get()); tracking.lastUndersideExitTick.put(player.getUUID(), now); diff --git a/common-1.21.1/src/main/resources/assets/antarchy/lang/en_us.json b/common-1.21.1/src/main/resources/assets/antarchy/lang/en_us.json index cc51a746..9eaadb4e 100644 --- a/common-1.21.1/src/main/resources/assets/antarchy/lang/en_us.json +++ b/common-1.21.1/src/main/resources/assets/antarchy/lang/en_us.json @@ -1652,5 +1652,15 @@ ,"subtitles.antarchy.hoverboard_dismount": "Hoverboard stops" ,"subtitles.antarchy.hoverboard_idle": "Hoverboard hums" , + "advancements.antarchy.through_the_throat.title": "Mind the Gap", + "advancements.antarchy.through_the_throat.description": "Fall through a gravity throat into the Underside.", + "advancements.antarchy.underside_castle.title": "Castle Upside Down", + "advancements.antarchy.underside_castle.description": "Find the castle hanging in the Underside.", + "advancements.antarchy.hive_awakened.title": "Rude Awakening", + "advancements.antarchy.hive_awakened.description": "Wake a Cavaryn horde.", + "advancements.antarchy.survived_the_horde.title": "The Hive Remembers", + "advancements.antarchy.survived_the_horde.description": "Survive a Cavaryn horde to its final wave and break it.", + "advancements.antarchy.glimmer_keeper.title": "Glimmer Keeper", + "advancements.antarchy.glimmer_keeper.description": "Tame every kind of Glimmer.", "entity.antarchy.portal_gun_portal": "Portal Gun Portal" } diff --git a/common-1.21.1/src/main/resources/data/antarchy/advancement/glimmer_keeper.json b/common-1.21.1/src/main/resources/data/antarchy/advancement/glimmer_keeper.json new file mode 100644 index 00000000..4aaaabde --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/advancement/glimmer_keeper.json @@ -0,0 +1,20 @@ +{ + "parent": "antarchy:visit_elythia", + "criteria": { + "apple_of_my_eye": { "conditions": { "variant": "apple_cow" }, "trigger": "antarchy:tamed_glimmer" }, + "deerly_beloved": { "conditions": { "variant": "ouranwood_deer" }, "trigger": "antarchy:tamed_glimmer" }, + "elkcellent_choice": { "conditions": { "variant": "elka" }, "trigger": "antarchy:tamed_glimmer" }, + "hoppy_together": { "conditions": { "variant": "frog" }, "trigger": "antarchy:tamed_glimmer" }, + "spirant_animal": { "conditions": { "variant": "ant" }, "trigger": "antarchy:tamed_glimmer" } + }, + "display": { + "announce_to_chat": true, + "description": { "translate": "advancements.antarchy.glimmer_keeper.description" }, + "frame": "challenge", + "icon": { "count": 1, "id": "antarchy:spirit_apple" }, + "show_toast": true, + "title": { "translate": "advancements.antarchy.glimmer_keeper.title" } + }, + "requirements": [["apple_of_my_eye"], ["deerly_beloved"], ["elkcellent_choice"], ["hoppy_together"], ["spirant_animal"]], + "sends_telemetry_event": true +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/advancement/hive_awakened.json b/common-1.21.1/src/main/resources/data/antarchy/advancement/hive_awakened.json new file mode 100644 index 00000000..70d0877b --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/advancement/hive_awakened.json @@ -0,0 +1,14 @@ +{ + "parent": "antarchy:anger_the_hive_mind", + "criteria": { "awakening": { "conditions": { "phase": "awakening" }, "trigger": "antarchy:horde_phase_changed" } }, + "display": { + "announce_to_chat": true, + "description": { "translate": "advancements.antarchy.hive_awakened.description" }, + "frame": "task", + "icon": { "count": 1, "id": "antarchy:tigers_eye_block" }, + "show_toast": true, + "title": { "translate": "advancements.antarchy.hive_awakened.title" } + }, + "requirements": [["awakening"]], + "sends_telemetry_event": true +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/advancement/survived_the_horde.json b/common-1.21.1/src/main/resources/data/antarchy/advancement/survived_the_horde.json new file mode 100644 index 00000000..ae84fcfb --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/advancement/survived_the_horde.json @@ -0,0 +1,14 @@ +{ + "parent": "antarchy:hive_awakened", + "criteria": { "completed": { "conditions": { "phase": "completed" }, "trigger": "antarchy:horde_phase_changed" } }, + "display": { + "announce_to_chat": true, + "description": { "translate": "advancements.antarchy.survived_the_horde.description" }, + "frame": "challenge", + "icon": { "count": 1, "id": "antarchy:hercules_horn" }, + "show_toast": true, + "title": { "translate": "advancements.antarchy.survived_the_horde.title" } + }, + "requirements": [["completed"]], + "sends_telemetry_event": true +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/advancement/through_the_throat.json b/common-1.21.1/src/main/resources/data/antarchy/advancement/through_the_throat.json new file mode 100644 index 00000000..992a8bc9 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/advancement/through_the_throat.json @@ -0,0 +1,19 @@ +{ + "parent": "antarchy:visit_thoraxis", + "criteria": { + "crossed_downward": { + "conditions": { "direction": "down" }, + "trigger": "antarchy:crossed_gravity_throat" + } + }, + "display": { + "announce_to_chat": true, + "description": { "translate": "advancements.antarchy.through_the_throat.description" }, + "frame": "goal", + "icon": { "count": 1, "id": "antarchy:dream_sand" }, + "show_toast": true, + "title": { "translate": "advancements.antarchy.through_the_throat.title" } + }, + "requirements": [["crossed_downward"]], + "sends_telemetry_event": true +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/advancement/underside_castle.json b/common-1.21.1/src/main/resources/data/antarchy/advancement/underside_castle.json new file mode 100644 index 00000000..490443bf --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/advancement/underside_castle.json @@ -0,0 +1,25 @@ +{ + "parent": "antarchy:through_the_throat", + "criteria": { + "discover_castle": { + "conditions": { + "player": [{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { "location": { "structures": "antarchy:underside_castle" } } + }] + }, + "trigger": "minecraft:location" + } + }, + "display": { + "announce_to_chat": true, + "description": { "translate": "advancements.antarchy.underside_castle.description" }, + "frame": "task", + "icon": { "count": 1, "id": "antarchy:dream_sand" }, + "show_toast": true, + "title": { "translate": "advancements.antarchy.underside_castle.title" } + }, + "requirements": [["discover_castle"]], + "sends_telemetry_event": true +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/computer_scientist_trades/trades.json b/common-1.21.1/src/main/resources/data/antarchy/computer_scientist_trades/trades.json index f36bcb6a..e0ff3d44 100644 --- a/common-1.21.1/src/main/resources/data/antarchy/computer_scientist_trades/trades.json +++ b/common-1.21.1/src/main/resources/data/antarchy/computer_scientist_trades/trades.json @@ -13,7 +13,6 @@ {"level": 4, "index": 2, "buy": {"item": "antarchy:antimetal", "min": 1, "max": 2}, "sell": {"item": "minecraft:emerald", "min": 8, "max": 16}}, {"level": 5, "index": 0, "buy": {"item": "minecraft:emerald", "min": 32, "max": 64}, "sell": {"item": "antarchy:uranium_nugget", "min": 1, "max": 1}}, {"level": 5, "index": 1, "buy": {"item": "minecraft:emerald", "min": 32, "max": 64}, "sell": {"item": "antarchy:titanium_nugget", "min": 1, "max": 1}}, - {"level": 5, "index": 2, "buy": {"item": "minecraft:emerald", "min": 16, "max": 32}, "sell": {"item": "antarchy:rainbow_sugar", "min": 1, "max": 2}}, - {"level": 5, "index": 3, "buy": {"item": "minecraft:emerald", "min": 24, "max": 40}, "sell": {"item": "antos:floppy_disk", "min": 1, "max": 1}, "sell_disk": "antarchy:antman_game", "max_uses": 1, "chance": 0.35} + {"level": 5, "index": 2, "buy": {"item": "minecraft:emerald", "min": 16, "max": 32}, "sell": {"item": "antarchy:rainbow_sugar", "min": 1, "max": 2}} ] } diff --git a/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/apple_cow_orchard.json b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/apple_cow_orchard.json new file mode 100644 index 00000000..ef42cb49 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/apple_cow_orchard.json @@ -0,0 +1,169 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 4, + "max": 7 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:apple", + "weight": 20, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 3, + "max": 8 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:golden_apple", + "weight": 2 + }, + { + "type": "minecraft:item", + "name": "minecraft:shears", + "weight": 4 + }, + { + "type": "minecraft:item", + "name": "antarchy:corn", + "weight": 12, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 8 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:high_fructose_corn_syrup", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:wheat", + "weight": 14, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 3, + "max": 10 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:bread", + "weight": 10, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:hay_block", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:emerald", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:kraken" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:high_fructose_corn_syrup" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:rainbow_ant" + } + } + ] + } + ] + } + ], + "random_sequence": "antarchy:chests/apple_cow_orchard" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/bedroom.json b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/bedroom.json new file mode 100644 index 00000000..0da813ae --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/bedroom.json @@ -0,0 +1,208 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 3, + "max": 6 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:ouranwood_acorn", + "weight": 12, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:peach", + "weight": 10, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:truffalo_log", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:duct_tape", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:bug_spray", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:critter_cage", + "weight": 4 + }, + { + "type": "minecraft:item", + "name": "minecraft:book", + "weight": 8 + }, + { + "type": "minecraft:item", + "name": "minecraft:paper", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 6 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:candle", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:brutalfly" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:elythia" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:flying_squirrel" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:glimmer" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:king" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:toreterror_arena" + } + } + ] + } + ] + } + ], + "random_sequence": "antarchy:chests/magical_castle/bedroom" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/generic.json b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/generic.json new file mode 100644 index 00000000..d63b32c6 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/generic.json @@ -0,0 +1,473 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 4, + "max": 7 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:white_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:orange_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:magenta_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:light_blue_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:yellow_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:lime_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:pink_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:gray_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:light_gray_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:cyan_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:purple_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:blue_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:brown_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:green_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:red_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:black_truffalo_tuft", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:truffalo_log", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 6 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:peach", + "weight": 12, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 6 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:ouranwood_acorn", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:peach_pie", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:cornbread", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:duct_tape", + "weight": 6, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:bug_spray", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:critter_cage", + "weight": 3 + }, + { + "type": "minecraft:item", + "name": "antarchy:uranium_nugget", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:titanium_nugget", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:brutalfly" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:elythia" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:flying_squirrel" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:glimmer" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:king" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:toreterror_arena" + } + } + ] + } + ] + } + ], + "random_sequence": "antarchy:chests/magical_castle/generic" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/kitchen.json b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/kitchen.json new file mode 100644 index 00000000..4a7420cd --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/loot_table/chests/magical_castle/kitchen.json @@ -0,0 +1,218 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 3, + "max": 6 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:peach", + "weight": 18, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 3, + "max": 8 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:peach_pie", + "weight": 12, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:cornbread", + "weight": 12, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:ouranwood_acorn", + "weight": 10, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:bread", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:cookie", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 6 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:apple", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:milk_bucket", + "weight": 3 + }, + { + "type": "minecraft:item", + "name": "antarchy:bug_spray", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:brutalfly" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:elythia" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:flying_squirrel" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:glimmer" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:king" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:toreterror_arena" + } + } + ] + } + ] + } + ], + "random_sequence": "antarchy:chests/magical_castle/kitchen" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/loot_table/spawners/magical_castle/hard.json b/common-1.21.1/src/main/resources/data/antarchy/loot_table/spawners/magical_castle/hard.json new file mode 100644 index 00000000..8bd228dc --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/loot_table/spawners/magical_castle/hard.json @@ -0,0 +1,321 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 3, + "max": 6 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:peach", + "weight": 14, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 3, + "max": 8 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:peach_pie", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:cornbread", + "weight": 10, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:ouranwood_acorn", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:truffalo_log", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 3, + "max": 6 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:duct_tape", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:bug_spray", + "weight": 6, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:critter_cage", + "weight": 4 + }, + { + "type": "minecraft:item", + "name": "minecraft:emerald", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:gold_ingot", + "weight": 6, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:brutalfly" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:elythia" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:flying_squirrel" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:glimmer" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:king" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:toreterror_arena" + } + } + ] + } + ] + }, + { + "rolls": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:uranium_nugget", + "weight": 7, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:titanium_nugget", + "weight": 7, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:golden_apple", + "weight": 7 + }, + { + "type": "minecraft:item", + "name": "minecraft:diamond", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:book", + "weight": 5, + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": { + "type": "minecraft:uniform", + "min": 12, + "max": 24 + }, + "options": "#minecraft:on_random_loot" + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:elythia" + } + } + ] + } + ] + } + ], + "random_sequence": "antarchy:spawners/magical_castle/hard" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/loot_table/spawners/magical_castle/medium.json b/common-1.21.1/src/main/resources/data/antarchy/loot_table/spawners/magical_castle/medium.json new file mode 100644 index 00000000..1ae95bac --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/loot_table/spawners/magical_castle/medium.json @@ -0,0 +1,306 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 3, + "max": 6 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:peach", + "weight": 16, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 6 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:peach_pie", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:cornbread", + "weight": 10, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:ouranwood_acorn", + "weight": 10, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:truffalo_log", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:duct_tape", + "weight": 8, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:bug_spray", + "weight": 6, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:critter_cage", + "weight": 3 + }, + { + "type": "minecraft:item", + "name": "minecraft:bread", + "weight": 10, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 2, + "max": 5 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:emerald", + "weight": 7, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:brutalfly" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:elythia" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:flying_squirrel" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:glimmer" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:king" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:toreterror_arena" + } + } + ] + } + ] + }, + { + "rolls": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:uranium_nugget", + "weight": 7, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "antarchy:titanium_nugget", + "weight": 7, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:golden_apple", + "weight": 6 + }, + { + "type": "minecraft:item", + "name": "minecraft:book", + "weight": 3, + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": { + "type": "minecraft:uniform", + "min": 8, + "max": 18 + }, + "options": "#minecraft:on_random_loot" + } + ] + }, + { + "type": "minecraft:item", + "name": "antos:floppy_disk", + "weight": 1, + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "antos:floppy_disk": "antarchy:elythia" + } + } + ] + } + ] + } + ], + "random_sequence": "antarchy:spawners/magical_castle/medium" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/apple_cow_orchard/apple_cow_orchard.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/apple_cow_orchard/apple_cow_orchard.nbt new file mode 100644 index 00000000..0c5e244b Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/apple_cow_orchard/apple_cow_orchard.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/greenhouse/greenhouse.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/greenhouse/greenhouse.nbt new file mode 100644 index 00000000..7346370e Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/greenhouse/greenhouse.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/magical_castle/magical_castle.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/magical_castle/magical_castle.nbt new file mode 100644 index 00000000..ead95c2c Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/magical_castle/magical_castle.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/magical_castle/magical_castle_path.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/magical_castle/magical_castle_path.nbt new file mode 100644 index 00000000..d6c30283 Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/magical_castle/magical_castle_path.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/king_shrine1.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/king_shrine1.nbt new file mode 100644 index 00000000..6901a862 Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/king_shrine1.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/king_shrine2.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/king_shrine2.nbt new file mode 100644 index 00000000..17fb877d Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/king_shrine2.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/queen_shrine1.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/queen_shrine1.nbt new file mode 100644 index 00000000..acfff1f8 Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/queen_shrine1.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/queen_shrine2.nbt b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/queen_shrine2.nbt new file mode 100644 index 00000000..ab34d4bd Binary files /dev/null and b/common-1.21.1/src/main/resources/data/antarchy/structure/royal_shrine/queen_shrine2.nbt differ diff --git a/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/apple_cow_orchard_biomes.json b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/apple_cow_orchard_biomes.json new file mode 100644 index 00000000..27f41957 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/apple_cow_orchard_biomes.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "#c:is_plains" + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/greenhouse_biomes.json b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/greenhouse_biomes.json new file mode 100644 index 00000000..d78507aa --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/greenhouse_biomes.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "antarchy:elythia_meadow", + "antarchy:truffalo_forest" + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/magical_castle_biomes.json b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/magical_castle_biomes.json new file mode 100644 index 00000000..d78507aa --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/magical_castle_biomes.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "antarchy:elythia_meadow", + "antarchy:truffalo_forest" + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/royal_shrine_biomes.json b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/royal_shrine_biomes.json new file mode 100644 index 00000000..a76da885 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/tags/worldgen/biome/has_structure/royal_shrine_biomes.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "antarchy:ouranwood_forest", + "antarchy:sparse_ouranwood_forest", + "antarchy:fungal_ouranwood_forest", + "antarchy:peach_forest", + "antarchy:truffalo_forest" + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/apple_cow_orchard.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/apple_cow_orchard.json new file mode 100644 index 00000000..c25a3f89 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/apple_cow_orchard.json @@ -0,0 +1,20 @@ +{ + "type": "integrated_api:generic_structure", + "start_pool": "antarchy:apple_cow_orchard/apple_cow_orchard", + "size": 1, + "terrain_height_radius_check": 3, + "allowed_terrain_height_range": 10, + "valid_biome_radius_check": 1, + "biomes": "#antarchy:has_structure/apple_cow_orchard_biomes", + "step": "surface_structures", + "terrain_adaptation": "beard_thin", + "project_start_to_heightmap": "WORLD_SURFACE_WG", + "start_height": { + "type": "minecraft:constant", + "value": { + "absolute": 0 + } + }, + "spawn_overrides": {}, + "liquid_settings": "ignore_waterlogging" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/greenhouse.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/greenhouse.json new file mode 100644 index 00000000..c5df19d6 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/greenhouse.json @@ -0,0 +1,20 @@ +{ + "type": "integrated_api:generic_structure", + "start_pool": "antarchy:greenhouse/greenhouse", + "size": 1, + "terrain_height_radius_check": 2, + "allowed_terrain_height_range": 8, + "valid_biome_radius_check": 1, + "biomes": "#antarchy:has_structure/greenhouse_biomes", + "step": "surface_structures", + "terrain_adaptation": "beard_thin", + "project_start_to_heightmap": "WORLD_SURFACE_WG", + "start_height": { + "type": "minecraft:constant", + "value": { + "absolute": 0 + } + }, + "spawn_overrides": {}, + "liquid_settings": "ignore_waterlogging" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/magical_castle.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/magical_castle.json new file mode 100644 index 00000000..229c99d5 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/magical_castle.json @@ -0,0 +1,20 @@ +{ + "type": "integrated_api:generic_structure", + "start_pool": "antarchy:magical_castle/magical_castle", + "size": 1, + "terrain_height_radius_check": 4, + "allowed_terrain_height_range": 14, + "valid_biome_radius_check": 1, + "biomes": "#antarchy:has_structure/magical_castle_biomes", + "step": "surface_structures", + "terrain_adaptation": "beard_thin", + "project_start_to_heightmap": "WORLD_SURFACE_WG", + "start_height": { + "type": "minecraft:constant", + "value": { + "absolute": 0 + } + }, + "spawn_overrides": {}, + "liquid_settings": "ignore_waterlogging" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/royal_shrine.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/royal_shrine.json new file mode 100644 index 00000000..3714550e --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure/royal_shrine.json @@ -0,0 +1,20 @@ +{ + "type": "integrated_api:generic_structure", + "start_pool": "antarchy:royal_shrine/royal_shrine", + "size": 1, + "terrain_height_radius_check": 2, + "allowed_terrain_height_range": 10, + "valid_biome_radius_check": 1, + "biomes": "#antarchy:has_structure/royal_shrine_biomes", + "step": "surface_structures", + "terrain_adaptation": "beard_thin", + "project_start_to_heightmap": "WORLD_SURFACE_WG", + "start_height": { + "type": "minecraft:constant", + "value": { + "absolute": 0 + } + }, + "spawn_overrides": {}, + "liquid_settings": "ignore_waterlogging" +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/apple_cow_orchard.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/apple_cow_orchard.json new file mode 100644 index 00000000..ed945776 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/apple_cow_orchard.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "antarchy:apple_cow_orchard", + "weight": 1 + } + ], + "placement": { + "salt": 369148227, + "spacing": 32, + "separation": 24, + "type": "integrated_api:advanced_random_spread" + } +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/elythia_common.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/elythia_common.json new file mode 100644 index 00000000..257446be --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/elythia_common.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "antarchy:royal_shrine", + "weight": 1 + } + ], + "placement": { + "salt": 718395621, + "spacing": 26, + "separation": 19, + "type": "integrated_api:advanced_random_spread" + } +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/elythia_rare.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/elythia_rare.json index fa60bb86..efa7ad47 100644 --- a/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/elythia_rare.json +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/structure_set/elythia_rare.json @@ -35,6 +35,14 @@ { "structure": "antarchy:toreterror_arena", "weight": 6 + }, + { + "structure": "antarchy:greenhouse", + "weight": 4 + }, + { + "structure": "antarchy:magical_castle", + "weight": 4 } ], "placement": { diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/apple_cow_orchard/apple_cow_orchard.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/apple_cow_orchard/apple_cow_orchard.json new file mode 100644 index 00000000..98b5e715 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/apple_cow_orchard/apple_cow_orchard.json @@ -0,0 +1,15 @@ +{ + "name": "antarchy:apple_cow_orchard/apple_cow_orchard", + "fallback": "minecraft:empty", + "elements": [ + { + "weight": 1, + "element": { + "location": "antarchy:apple_cow_orchard/apple_cow_orchard", + "processors": "antarchy:generic_processor", + "projection": "rigid", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + } + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/greenhouse/greenhouse.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/greenhouse/greenhouse.json new file mode 100644 index 00000000..ef23ed4d --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/greenhouse/greenhouse.json @@ -0,0 +1,15 @@ +{ + "name": "antarchy:greenhouse/greenhouse", + "fallback": "minecraft:empty", + "elements": [ + { + "weight": 1, + "element": { + "location": "antarchy:greenhouse/greenhouse", + "processors": "antarchy:generic_processor", + "projection": "rigid", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + } + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/magical_castle/magical_castle.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/magical_castle/magical_castle.json new file mode 100644 index 00000000..5df8fb98 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/magical_castle/magical_castle.json @@ -0,0 +1,15 @@ +{ + "name": "antarchy:magical_castle/magical_castle", + "fallback": "minecraft:empty", + "elements": [ + { + "weight": 1, + "element": { + "location": "antarchy:magical_castle/magical_castle", + "processors": "antarchy:generic_processor", + "projection": "terrain_matching", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + } + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/magical_castle/magical_castle_path.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/magical_castle/magical_castle_path.json new file mode 100644 index 00000000..41082972 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/magical_castle/magical_castle_path.json @@ -0,0 +1,15 @@ +{ + "name": "antarchy:magical_castle/magical_castle_path", + "fallback": "minecraft:empty", + "elements": [ + { + "weight": 1, + "element": { + "location": "antarchy:magical_castle/magical_castle_path", + "processors": "antarchy:generic_processor", + "projection": "terrain_matching", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + } + ] +} diff --git a/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/royal_shrine/royal_shrine.json b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/royal_shrine/royal_shrine.json new file mode 100644 index 00000000..3101be39 --- /dev/null +++ b/common-1.21.1/src/main/resources/data/antarchy/worldgen/template_pool/royal_shrine/royal_shrine.json @@ -0,0 +1,42 @@ +{ + "name": "antarchy:royal_shrine/royal_shrine", + "fallback": "minecraft:empty", + "elements": [ + { + "weight": 1, + "element": { + "location": "antarchy:royal_shrine/king_shrine1", + "processors": "antarchy:generic_processor", + "projection": "rigid", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + }, + { + "weight": 1, + "element": { + "location": "antarchy:royal_shrine/king_shrine2", + "processors": "antarchy:generic_processor", + "projection": "rigid", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + }, + { + "weight": 1, + "element": { + "location": "antarchy:royal_shrine/queen_shrine1", + "processors": "antarchy:generic_processor", + "projection": "rigid", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + }, + { + "weight": 1, + "element": { + "location": "antarchy:royal_shrine/queen_shrine2", + "processors": "antarchy:generic_processor", + "projection": "rigid", + "element_type": "integrated_api:integrated_api_single_pool_element" + } + } + ] +} diff --git a/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java b/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java index 83a9eb64..fdb93e57 100644 --- a/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java +++ b/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java @@ -3,6 +3,7 @@ import com.craisinlord.antarchy.fabric.registry.AntarchyFabricEntities; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.AntarchyGameRules; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancementTriggers; import com.craisinlord.antarchy.content.entity.trades.DrTrayaurusTradeManager; import com.craisinlord.antarchy.content.entity.trades.ComputerScientistTradeManager; import com.craisinlord.antarchy.content.item.BloodCrystalShardItem; @@ -158,6 +159,7 @@ public final class AntarchyFabric implements ModInitializer { registerWorldgenFeatures(); BloodglassManager.register(); TigerEyeFabricManager.register(); + AntarchyAdvancementTriggers.register(); Antarchy.init(); BloodCrystalShardItem.SYNC_BLOODGLASS = BloodglassManager::syncBloodglass; registerTradeReloadListener(); diff --git a/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java b/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java index a9d2f39d..ced1168d 100644 --- a/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java +++ b/fabric-1.21.1/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java @@ -18,6 +18,7 @@ import com.craisinlord.antarchy.content.gravity.AntarchyGravityTransition; import com.craisinlord.antarchy.content.horde.CavarynHordeManager; import com.craisinlord.antarchy.content.portal.PermanentPortalManager; import com.craisinlord.antarchy.content.portalgun.PortalGunProjectileEntity; +import com.craisinlord.antarchy.content.portalgun.PortalGunSavedData; import com.craisinlord.antarchy.content.command.CavarynCommand; import com.craisinlord.antarchy.content.command.CaterpillarCommand; import com.craisinlord.antarchy.content.command.DimensionalTearCommand; @@ -81,6 +82,7 @@ public final class AntarchyFabricEvents { ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> { ChronosphereManager.refresh(handler.player); TimeDilationManager.resyncPersistentEffects(handler.player); + PortalGunSavedData.clearMissingGuns(handler.player); }); ServerPlayerEvents.AFTER_RESPAWN.register((oldPlayer, newPlayer, alive) -> { ChronosphereManager.refresh(newPlayer); diff --git a/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java b/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java index ec6f57cf..7b2cf7e6 100644 --- a/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java +++ b/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java @@ -6,6 +6,7 @@ import com.craisinlord.antarchy.compat.infinity.InfinityCompatVersion; import com.craisinlord.antarchy.content.AntarchyGameRules; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchySoundEvents; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancementTriggers; import com.craisinlord.antarchy.content.item.BloodCrystalKatanaItem; import com.craisinlord.antarchy.content.item.ScorpionWhipTetherSync; import com.craisinlord.antarchy.content.network.BloodCrystalKatanaTrailPayload; @@ -17,7 +18,9 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModList; import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.registries.RegisterEvent; import net.neoforged.neoforge.network.PacketDistributor; +import net.minecraft.core.registries.Registries; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -29,6 +32,7 @@ public class AntarchyNeoforge { public AntarchyNeoforge(IEventBus modEventBus, ModContainer modContainer) { modEventBusTempHolder = modEventBus; + modEventBus.addListener(AntarchyNeoforge::registerAdvancementTriggers); bootstrapGameRules(); AntarchyConfigModuleNeoforge.init(modContainer); AntarchySoundEvents.bind( @@ -296,6 +300,13 @@ public class AntarchyNeoforge { Antarchy.init(); } + private static void registerAdvancementTriggers(RegisterEvent event) { + if (event.getRegistryKey().equals(Registries.TRIGGER_TYPE)) { + AntarchyAdvancementTriggers.register((id, trigger) -> + event.register(Registries.TRIGGER_TYPE, id, () -> trigger)); + } + } + @SuppressWarnings("unchecked") private static void bootstrapGameRules() { AntarchyGameRules.bootstrap((name, category, defaultValue) -> { diff --git a/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/registry/PortalGunServerEvents.java b/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/registry/PortalGunServerEvents.java index 5d63c255..235f4543 100644 --- a/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/registry/PortalGunServerEvents.java +++ b/neoforge-1.21.1/src/main/java/com/craisinlord/antarchy/neoforge/registry/PortalGunServerEvents.java @@ -4,6 +4,7 @@ import com.craisinlord.antarchy.Antarchy; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.event.server.ServerStoppingEvent; +import net.neoforged.neoforge.event.entity.player.PlayerEvent; @EventBusSubscriber(modid = Antarchy.MODID) public final class PortalGunServerEvents { @@ -15,4 +16,11 @@ public final class PortalGunServerEvents { com.craisinlord.antarchy.content.portalgun.PortalGunResetManager.clear(event.getServer()); com.craisinlord.antarchy.content.entity.ant.AntArrivalScheduler.clear(); } + + @SubscribeEvent + public static void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { + if (event.getEntity() instanceof net.minecraft.server.level.ServerPlayer player) { + com.craisinlord.antarchy.content.portalgun.PortalGunSavedData.clearMissingGuns(player); + } + } }