Class EffectHolder
java.lang.Object
net.lcc.sollib.api.common.registry.SHolder<net.minecraft.world.effect.MobEffect>
net.lcc.sollib.api.common.registry.holder.EffectHolder
- All Implemented Interfaces:
Supplier<net.minecraft.world.effect.MobEffect>
A holder class for effect registry using a
SolModContainer-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEffectHolder(SolModContainer mod, String name, Supplier<net.minecraft.world.effect.MobEffect> entrySupplier) -
Method Summary
Modifier and TypeMethodDescriptionSupplier<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> Supplier<net.minecraft.world.level.ItemLike> Supplier<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> Supplier<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> net.minecraft.core.Registry<net.minecraft.world.effect.MobEffect> Supplier<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> booleanbooleanbooleanvoidregisterPotion(Consumer<SHolder<net.minecraft.world.item.alchemy.Potion>> registrar) withPotion(Supplier<net.minecraft.world.item.alchemy.Potion> base, Supplier<net.minecraft.world.level.ItemLike> ingredient) Registers a potion for this effectwithPotion(Supplier<net.minecraft.world.item.alchemy.Potion> base, Supplier<net.minecraft.world.level.ItemLike> ingredient, int duration) Registers a potion for this effectwithPotion(Supplier<net.minecraft.world.item.alchemy.Potion> base, Supplier<net.minecraft.world.level.ItemLike> ingredient, int duration, boolean hasLong, boolean hasStrong) Registers a potion for this effectwithPotion(Supplier<net.minecraft.world.level.ItemLike> ingredient) Registers a potion for this effect
-
Field Details
-
DURATION
public static final int DURATION- See Also:
-
-
Constructor Details
-
EffectHolder
public EffectHolder(SolModContainer mod, String name, Supplier<net.minecraft.world.effect.MobEffect> entrySupplier)
-
-
Method Details
-
getRegistry
public net.minecraft.core.Registry<net.minecraft.world.effect.MobEffect> getRegistry()- Overrides:
getRegistryin classSHolder<net.minecraft.world.effect.MobEffect>
-
withPotion
Registers a potion for this effect- Parameters:
ingredient- What ingredient must be added to brew this
-
withPotion
public EffectHolder withPotion(Supplier<net.minecraft.world.item.alchemy.Potion> base, Supplier<net.minecraft.world.level.ItemLike> ingredient) Registers a potion for this effect- Parameters:
base- What potion this is brewed from (egPotions.AWKWARD)ingredient- What ingredient must be added to brew this
-
withPotion
public EffectHolder withPotion(Supplier<net.minecraft.world.item.alchemy.Potion> base, Supplier<net.minecraft.world.level.ItemLike> ingredient, int duration) Registers a potion for this effect- Parameters:
base- What potion this is brewed from (egPotions.AWKWARD)ingredient- What ingredient must be added to brew thisduration- The duration for said potion
-
withPotion
public EffectHolder withPotion(Supplier<net.minecraft.world.item.alchemy.Potion> base, Supplier<net.minecraft.world.level.ItemLike> ingredient, int duration, boolean hasLong, boolean hasStrong) Registers a potion for this effect- Parameters:
base- What potion this is brewed from (egPotions.AWKWARD)ingredient- What ingredient must be added to brew thisduration- The duration for said potionhasLong- Should a long variant be registered toohasStrong- Should a strong variant be registered too
-
hasPotion
public boolean hasPotion() -
hasLongPotion
public boolean hasLongPotion() -
hasStrongPotion
public boolean hasStrongPotion() -
getCraftingBase
public Supplier<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> getCraftingBase() -
getCraftingIngredient
-
getPotion
-
getLongPotion
-
getStrongPotion
public Supplier<net.minecraft.core.Holder<net.minecraft.world.item.alchemy.Potion>> getStrongPotion() -
registerPotion
-