Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/datagen/java/wayoftime/bloodmagic/Datagen.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.neoforged.neoforge.data.event.GatherDataEvent;
import wayoftime.bloodmagic.api.BMIdentifiers.RegistryKeys;
import wayoftime.bloodmagic.common.registry.BMRegistries;
import wayoftime.bloodmagic.datagen.content.AltarTiers;
import wayoftime.bloodmagic.datagen.content.BloodyDamageSources;
import wayoftime.bloodmagic.datagen.content.BMDamageTypes;
import wayoftime.bloodmagic.datagen.content.ImperfectRitualData;
import wayoftime.bloodmagic.datagen.content.LivingUpgrades;
import wayoftime.bloodmagic.datagen.content.SigilData;
Expand All @@ -32,17 +31,17 @@ public static void gatherData(GatherDataEvent event) {
event.createProvider(BMLanguageProvider::new);

event.createDatapackRegistryObjects(new RegistrySetBuilder()
.add(Registries.DAMAGE_TYPE, BloodyDamageSources::bootstrap)
.add(BMRegistries.Keys.ALTAR_TIER_KEY, AltarTiers::bootstrap)
.add(BMRegistries.Keys.LIVING_UPGRADES, LivingUpgrades::bootstrap)
.add(BMRegistries.Keys.IMPERFECT_RITUALS, ImperfectRitualData::effects)
.add(Registries.DAMAGE_TYPE, BMDamageTypes::types)
.add(RegistryKeys.ALTAR_TIER_KEY, AltarTiers::tiers)
.add(RegistryKeys.LIVING_UPGRADES, LivingUpgrades::upgrades)
.add(RegistryKeys.IMPERFECT_RITUALS, ImperfectRitualData::effects)
.add(RegistryKeys.SIGIL_EFFECT, SigilData::sigilTypes)
);

ProviderHelper helper = new ProviderHelper(fileHelper);

event.createProvider(helper.tagsFor(BMRegistries.Keys.LIVING_UPGRADES, LivingUpgrades::tags));
event.createProvider(helper.tagsFor(Registries.DAMAGE_TYPE, BloodyDamageSources::tags));
event.createProvider(helper.tagsFor(RegistryKeys.LIVING_UPGRADES, LivingUpgrades::tags));
event.createProvider(helper.tagsFor(Registries.DAMAGE_TYPE, BMDamageTypes::tags));
event.createBlockAndItemTags(BMBlockTagProvider::new, BMItemTagProvider::new);

event.createProvider(BMDataMapProvider::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.ExtraCodecs.TagOrElementLocation;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.common.registry.AltarTier;
import wayoftime.bloodmagic.common.registry.BMRegistries;
import wayoftime.bloodmagic.common.tag.BMTags;
import wayoftime.bloodmagic.api.BMIdentifiers;
import wayoftime.bloodmagic.api.altar.AltarTier;
import wayoftime.bloodmagic.api.BMTags;

public class AltarTiers {

public static void bootstrap(BootstrapContext<AltarTier> builder) {
public static void tiers(BootstrapContext<AltarTier> builder) {
builder.register(Keys.APPRENTICE, APPRENTICE);
builder.register(Keys.MAGE, MAGE);
builder.register(Keys.MASTER, MASTER);
Expand All @@ -24,12 +24,12 @@ protected static ResourceLocation bm(String path) {
}

public static class Keys {
public static final ResourceKey<AltarTier> WEAK = ResourceKey.create(BMRegistries.Keys.ALTAR_TIER_KEY, Locs.WEAK);
public static final ResourceKey<AltarTier> APPRENTICE = ResourceKey.create(BMRegistries.Keys.ALTAR_TIER_KEY, Locs.APPRENTICE);
public static final ResourceKey<AltarTier> MAGE = ResourceKey.create(BMRegistries.Keys.ALTAR_TIER_KEY, Locs.MAGE);
public static final ResourceKey<AltarTier> MASTER = ResourceKey.create(BMRegistries.Keys.ALTAR_TIER_KEY, Locs.MASTER);
public static final ResourceKey<AltarTier> ARCHMAGE = ResourceKey.create(BMRegistries.Keys.ALTAR_TIER_KEY, Locs.ARCHMAGE);
public static final ResourceKey<AltarTier> TRANSCENDENT = ResourceKey.create(BMRegistries.Keys.ALTAR_TIER_KEY, Locs.TRANSCENDENT);
public static final ResourceKey<AltarTier> WEAK = ResourceKey.create(BMIdentifiers.RegistryKeys.ALTAR_TIER_KEY, Locs.WEAK);
public static final ResourceKey<AltarTier> APPRENTICE = ResourceKey.create(BMIdentifiers.RegistryKeys.ALTAR_TIER_KEY, Locs.APPRENTICE);
public static final ResourceKey<AltarTier> MAGE = ResourceKey.create(BMIdentifiers.RegistryKeys.ALTAR_TIER_KEY, Locs.MAGE);
public static final ResourceKey<AltarTier> MASTER = ResourceKey.create(BMIdentifiers.RegistryKeys.ALTAR_TIER_KEY, Locs.MASTER);
public static final ResourceKey<AltarTier> ARCHMAGE = ResourceKey.create(BMIdentifiers.RegistryKeys.ALTAR_TIER_KEY, Locs.ARCHMAGE);
public static final ResourceKey<AltarTier> TRANSCENDENT = ResourceKey.create(BMIdentifiers.RegistryKeys.ALTAR_TIER_KEY, Locs.TRANSCENDENT);
}

public static class Locs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@
import net.minecraft.tags.TagKey;
import net.minecraft.world.damagesource.DamageScaling;
import net.minecraft.world.damagesource.DamageType;
import wayoftime.bloodmagic.common.damagesource.BMDamageSources;
import wayoftime.bloodmagic.common.tag.BMTags;
import wayoftime.bloodmagic.api.BMIdentifiers.DamageTypes;
import wayoftime.bloodmagic.api.BMTags;

import java.util.function.Function;

public class BloodyDamageSources {
public static void bootstrap(BootstrapContext<DamageType> context) {
context.register(BMDamageSources.SACRIFICE, new DamageType("sacrifice", DamageScaling.NEVER, 0F));
context.register(BMDamageSources.SELF_SACRIFICE, new DamageType("self_sacrifice", DamageScaling.NEVER, 0F));
public class BMDamageTypes {
public static void types(BootstrapContext<DamageType> context) {
context.register(DamageTypes.SACRIFICE, new DamageType("sacrifice", DamageScaling.NEVER, 0F));
context.register(DamageTypes.SELF_SACRIFICE, new DamageType("self_sacrifice", DamageScaling.NEVER, 0F));
}

public static void tags(Function<TagKey<DamageType>, TagsProvider.TagAppender<DamageType>> setter) {
setter.apply(DamageTypeTags.BYPASSES_ARMOR)
.add(BMDamageSources.SELF_SACRIFICE)
.add(BMDamageSources.SACRIFICE);
.add(DamageTypes.SELF_SACRIFICE)
.add(DamageTypes.SACRIFICE);

setter.apply(DamageTypeTags.BYPASSES_EFFECTS)
.add(BMDamageSources.SELF_SACRIFICE)
.add(BMDamageSources.SACRIFICE);
.add(DamageTypes.SELF_SACRIFICE)
.add(DamageTypes.SACRIFICE);

setter.apply(DamageTypeTags.BYPASSES_INVULNERABILITY)
.add(BMDamageSources.SELF_SACRIFICE)
.add(BMDamageSources.SACRIFICE);
.add(DamageTypes.SELF_SACRIFICE)
.add(DamageTypes.SACRIFICE);

setter.apply(DamageTypeTags.NO_IMPACT)
.add(BMDamageSources.SELF_SACRIFICE)
.add(BMDamageSources.SACRIFICE);
.add(DamageTypes.SELF_SACRIFICE)
.add(DamageTypes.SACRIFICE);

setter.apply(DamageTypeTags.NO_KNOCKBACK)
.add(BMDamageSources.SELF_SACRIFICE)
.add(BMDamageSources.SACRIFICE);
.add(DamageTypes.SELF_SACRIFICE)
.add(DamageTypes.SACRIFICE);

setter.apply(BMTags.DamageTypes.SELF_SACRIFICE)
.add(BMDamageSources.SELF_SACRIFICE); // needed later for damage predicates
.add(DamageTypes.SELF_SACRIFICE); // needed later for damage predicates

setter.apply(BMTags.DamageTypes.TOUGH_IGNORED)
.addTag(DamageTypeTags.IS_FIRE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
import net.neoforged.neoforge.common.Tags;
import net.neoforged.neoforge.common.data.DataMapProvider;
import net.neoforged.neoforge.registries.datamaps.DataMapType;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.api.BMIdentifiers;
import wayoftime.bloodmagic.api.BMIdentifiers.ImperfectRituals;
import wayoftime.bloodmagic.common.datamap.BMDataMaps;
import wayoftime.bloodmagic.common.registry.BMRegistries;
import wayoftime.bloodmagic.common.ritual.imperfect.ApplyPotionEffect;
import wayoftime.bloodmagic.common.ritual.imperfect.ImperfectRitualEffect;
import wayoftime.bloodmagic.api.ritual.ImperfectRitualEffect;
import wayoftime.bloodmagic.common.ritual.imperfect.SetTimeEffect;
import wayoftime.bloodmagic.common.ritual.imperfect.SpawnMobEffect;

Expand All @@ -40,7 +38,7 @@ public static void effects(BootstrapContext<ImperfectRitualEffect> context) {
}

private static ResourceKey<ImperfectRitualEffect> key(ResourceLocation id) {
return ResourceKey.create(BMRegistries.Keys.IMPERFECT_RITUALS, id);
return ResourceKey.create(BMIdentifiers.RegistryKeys.IMPERFECT_RITUALS, id);
}

public static void dataMap(Function<DataMapType<Block, ResourceLocation>, DataMapProvider.Builder<ResourceLocation, Block>> setup) {
Expand Down
Loading