Class ImmersiveMCClientRegistrationImpl
java.lang.Object
com.hammy275.immersivemc.client.api_impl.ImmersiveMCClientRegistrationImpl
- All Implemented Interfaces:
ImmersiveMCClientRegistration
public class ImmersiveMCClientRegistrationImpl
extends Object
implements ImmersiveMCClientRegistration
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addImmersiveRegistrationHandler
(Consumer<ImmersiveMCRegistrationEvent<Immersive<?, ?>>> registrationHandler) Registers an object which, at some point, ImmersiveMC will call to register yourImmersives
s.createConfigScreenInfoMultipleItems
(String modID, String optionTranslation, Supplier<Set<net.minecraft.world.item.ItemStack>> optionItem, @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer) Creates anImmersiveConfigScreenInfo
instance.createConfigScreenInfoOneItem
(String modID, String optionTranslation, Supplier<net.minecraft.world.item.ItemStack> optionItem, @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer) Creates anImmersiveConfigScreenInfo
instance.static void
doImmersiveRegistration
(Consumer<Immersive<?, ?>> immersiveConsumer)
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ImmersiveMCClientRegistrationImpl
public ImmersiveMCClientRegistrationImpl()
-
-
Method Details
-
doImmersiveRegistration
-
createConfigScreenInfoOneItem
public ImmersiveConfigScreenInfo createConfigScreenInfoOneItem(String modID, String optionTranslation, Supplier<net.minecraft.world.item.ItemStack> optionItem, @Nullable @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer) Description copied from interface:ImmersiveMCClientRegistration
Creates anImmersiveConfigScreenInfo
instance. See the aforementioned interface for more information.- Specified by:
createConfigScreenInfoOneItem
in interfaceImmersiveMCClientRegistration
- Parameters:
modID
- The mod ID as described in the javadoc forImmersiveConfigScreenInfo.getModID()
.optionTranslation
- The translation string for the button label as described in the javadoc forImmersiveConfigScreenInfo.getOptionTranslation()
.optionItem
- A supplier for the item representing this Immersive as described in the javadoc forImmersiveConfigScreenInfo.getOptionItems()
.optionTooltip
- An optional tooltip describing this Immersive and this option as described in the javadoc forImmersiveConfigScreenInfo.getOptionTooltip()
.isEnabledSupplier
- A supplier that, when called, returns whether this Immersive is enabled. This method should NOT ever provide null as a value.setEnabledConsumer
- A consumer that will be provided a non-null Boolean denoting a new enabled/disabled state for the Immersive.- Returns:
- An
ImmersiveConfigScreenInfo
instance.
-
createConfigScreenInfoMultipleItems
public ImmersiveConfigScreenInfo createConfigScreenInfoMultipleItems(String modID, String optionTranslation, Supplier<Set<net.minecraft.world.item.ItemStack>> optionItem, @Nullable @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer) Description copied from interface:ImmersiveMCClientRegistration
Creates anImmersiveConfigScreenInfo
instance. See the aforementioned interface for more information.- Specified by:
createConfigScreenInfoMultipleItems
in interfaceImmersiveMCClientRegistration
- Parameters:
modID
- The mod ID as described in the javadoc forImmersiveConfigScreenInfo.getModID()
.optionTranslation
- The translation string for the button label as described in the javadoc forImmersiveConfigScreenInfo.getOptionTranslation()
.optionItem
- A supplier for the items representing this Immersive as described in the javadoc forImmersiveConfigScreenInfo.getOptionItems()
.optionTooltip
- An optional tooltip describing this Immersive and this option as described in the javadoc forImmersiveConfigScreenInfo.getOptionTooltip()
.isEnabledSupplier
- A supplier that, when called, returns whether this Immersive is enabled. This method should NOT ever provide null as a value.setEnabledConsumer
- A consumer that will be provided a non-null Boolean denoting a new enabled/disabled state for the Immersive.- Returns:
- An
ImmersiveConfigScreenInfo
instance.
-
addImmersiveRegistrationHandler
public void addImmersiveRegistrationHandler(Consumer<ImmersiveMCRegistrationEvent<Immersive<?, ?>>> registrationHandler) throws IllegalStateExceptionDescription copied from interface:ImmersiveMCClientRegistration
Registers an object which, at some point, ImmersiveMC will call to register yourImmersives
s. The time at which registration occurs is only guaranteed to be some time after mods are initially constructed, so handlers should be added here as early as possible, and be prepared for a lack of registry availability.- Specified by:
addImmersiveRegistrationHandler
in interfaceImmersiveMCClientRegistration
- Parameters:
registrationHandler
- Your object that will register Immersives when called.- Throws:
IllegalStateException
- This method was called after registration.
-