Skip to content

Commit

Permalink
Move criteria trigger registration to registry
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealWormbo authored and artemisSystem committed Aug 28, 2024
1 parent 3613a88 commit da7fffb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private void registryInit() {
BotaniaFeatures.MYSTICAL_MUSHROOMS_PLACED_FEATURE);

// Rest
BotaniaCriteriaTriggers.init();
BotaniaCriteriaTriggers.init(bind(BuiltInRegistries.TRIGGER_TYPES));
BotaniaParticles.registerParticles(bind(BuiltInRegistries.PARTICLE_TYPE));
BotaniaLootModifiers.submitLootConditions(bind(BuiltInRegistries.LOOT_CONDITION_TYPE));
BotaniaLootModifiers.submitLootFunctions(bind(BuiltInRegistries.LOOT_FUNCTION_TYPE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private void registryInit() {
bind(Registries.CHUNK_GENERATOR, SkyblockChunkGenerator::submitRegistration);

// Rest
BotaniaCriteriaTriggers.init();
bind(Registries.TRIGGER_TYPE, BotaniaCriteriaTriggers::init);
bind(Registries.PARTICLE_TYPE, BotaniaParticles::registerParticles);

bind(Registries.LOOT_CONDITION_TYPE, BotaniaLootModifiers::submitLootConditions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
*/
package vazkii.botania.common.advancements;

import vazkii.botania.mixin.CriteriaTriggersAccessor;
import net.minecraft.advancements.CriterionTrigger;
import net.minecraft.resources.ResourceLocation;

import java.util.function.BiConsumer;

public class BotaniaCriteriaTriggers {
public static void init() {
CriteriaTriggersAccessor.botania_register(AlfheimPortalTrigger.INSTANCE);
CriteriaTriggersAccessor.botania_register(CorporeaRequestTrigger.INSTANCE);
CriteriaTriggersAccessor.botania_register(GaiaGuardianNoArmorTrigger.INSTANCE);
CriteriaTriggersAccessor.botania_register(RelicBindTrigger.INSTANCE);
CriteriaTriggersAccessor.botania_register(UseItemSuccessTrigger.INSTANCE);
CriteriaTriggersAccessor.botania_register(ManaBlasterTrigger.INSTANCE);
CriteriaTriggersAccessor.botania_register(LokiPlaceTrigger.INSTANCE);
CriteriaTriggersAccessor.botania_register(AlfheimPortalBreadTrigger.INSTANCE);
public static void init(BiConsumer<CriterionTrigger<?>, ResourceLocation> r) {
r.accept(AlfheimPortalTrigger.INSTANCE, AlfheimPortalTrigger.ID);
r.accept(CorporeaRequestTrigger.INSTANCE, CorporeaRequestTrigger.ID);
r.accept(GaiaGuardianNoArmorTrigger.INSTANCE, GaiaGuardianNoArmorTrigger.ID);
r.accept(RelicBindTrigger.INSTANCE, RelicBindTrigger.ID);
r.accept(UseItemSuccessTrigger.INSTANCE, UseItemSuccessTrigger.ID);
r.accept(ManaBlasterTrigger.INSTANCE, ManaBlasterTrigger.ID);
r.accept(LokiPlaceTrigger.INSTANCE, LokiPlaceTrigger.ID);
r.accept(AlfheimPortalBreadTrigger.INSTANCE, AlfheimPortalBreadTrigger.ID);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;

public class ManaBlasterTrigger extends SimpleCriterionTrigger<ManaBlasterTrigger.Instance> {
private static final ResourceLocation ID = prefix("fire_mana_blaster");
public static final ResourceLocation ID = prefix("fire_mana_blaster");
public static final ManaBlasterTrigger INSTANCE = new ManaBlasterTrigger();

private ManaBlasterTrigger() {}
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion Xplat/src/main/resources/botania_xplat.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"CollectingNeighborUpdaterMixin",
"CreeperAccessor",
"CreeperMixin",
"CriteriaTriggersAccessor",
"DispenserBlockAccessor",
"EntityAccessor",
"EntityMixin",
Expand Down

0 comments on commit da7fffb

Please sign in to comment.