diff --git a/src/main/java/de/teamlapen/vampirism/core/ModDataComponents.java b/src/main/java/de/teamlapen/vampirism/core/ModDataComponents.java index 1ac56977b..f881de450 100644 --- a/src/main/java/de/teamlapen/vampirism/core/ModDataComponents.java +++ b/src/main/java/de/teamlapen/vampirism/core/ModDataComponents.java @@ -9,19 +9,13 @@ import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.util.Unit; -import net.minecraft.world.item.enchantment.ConditionalEffect; -import net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect; -import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; -import java.util.List; - public class ModDataComponents { public static final DeferredRegister.DataComponents ITEM_DATA_COMPONENTS = DeferredRegister.createDataComponents(Registries.DATA_COMPONENT_TYPE, REFERENCE.MODID); - public static final DeferredRegister.DataComponents ENCHANTMENT_DATA_COMPONENTS = DeferredRegister.createDataComponents(Registries.ENCHANTMENT_EFFECT_COMPONENT_TYPE, REFERENCE.MODID); public static final DeferredHolder, DataComponentType> OIL = ITEM_DATA_COMPONENTS.register(VampirismDataComponents.Keys.OIL_CONTENTS.getPath(), () -> DataComponentType.builder().persistent(OilContent.CODEC).networkSynchronized(OilContent.STREAM_CODEC).cacheEncoding().build()); public static final DeferredHolder, DataComponentType> APPLIED_OIL = ITEM_DATA_COMPONENTS.register(VampirismDataComponents.Keys.APPLIED_OIL.getPath(), () -> DataComponentType.builder().persistent(AppliedOilContent.CODEC).networkSynchronized(AppliedOilContent.STREAM_CODEC).cacheEncoding().build()); @@ -37,10 +31,8 @@ public class ModDataComponents { public static final DeferredHolder, DataComponentType> BOTTLE_BLOOD = ITEM_DATA_COMPONENTS.registerComponentType(VampirismDataComponents.Keys.BOTTLE_BLOOD.getPath(), (builder) -> builder.persistent(BottleBlood.CODEC).networkSynchronized(BottleBlood.STREAM_CODEC)); public static final DeferredHolder, DataComponentType> CROSSBOW_FRUGALITY_TRIGGERED = ITEM_DATA_COMPONENTS.registerComponentType("crossbow_frugality_triggered", (builder) -> builder.persistent(Codec.unit(Unit.INSTANCE)).networkSynchronized(StreamCodec.unit(Unit.INSTANCE))); public static final DeferredHolder, DataComponentType> IS_FACTION_BANNER = ITEM_DATA_COMPONENTS.registerComponentType(VampirismDataComponents.Keys.IS_FACTION_BANNER.getPath(), (builder) -> builder.persistent(Unit.CODEC).networkSynchronized(StreamCodec.unit(Unit.INSTANCE))); - public static final DeferredHolder, DataComponentType>>> FRUGALITY = ENCHANTMENT_DATA_COMPONENTS.registerComponentType(VampirismDataComponents.Keys.FRUGALITY.getPath(), (builder) -> builder.persistent(ConditionalEffect.codec(EnchantmentValueEffect.CODEC, LootContextParamSets.ENCHANTED_DAMAGE).listOf())); static void register(IEventBus eventBus) { ITEM_DATA_COMPONENTS.register(eventBus); - ENCHANTMENT_DATA_COMPONENTS.register(eventBus); } }