Interface ImmersiveMCClientRegistration
- All Known Implementing Classes:
ImmersiveMCClientRegistrationImpl
public interface ImmersiveMCClientRegistration
Contains methods for registering Immersives to ImmersiveMC.
-
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>> optionItems, @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.instance()
-
Method Details
-
instance
- Returns:
- An ImmersiveMCClientRegistration instance to access API functions. All details of this object not mentioned in this file are assumed to be an implementation detail, and may change at any time.
-
createConfigScreenInfoOneItem
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) Creates anImmersiveConfigScreenInfo
instance. See the aforementioned interface for more information.- 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
ImmersiveConfigScreenInfo createConfigScreenInfoMultipleItems(String modID, String optionTranslation, Supplier<Set<net.minecraft.world.item.ItemStack>> optionItems, @Nullable @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer) Creates anImmersiveConfigScreenInfo
instance. See the aforementioned interface for more information.- 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()
.optionItems
- 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
void addImmersiveRegistrationHandler(Consumer<ImmersiveMCRegistrationEvent<Immersive<?, ?>>> registrationHandler) throws IllegalStateExceptionRegisters 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.- Parameters:
registrationHandler
- Your object that will register Immersives when called.- Throws:
IllegalStateException
- This method was called after registration.
-