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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImmersiveRegistrationHandler(Consumer<ImmersiveMCRegistrationEvent<Immersive<?, ?>>> registrationHandler) Registers an object which, at some point, ImmersiveMC will call to register yourImmersivess.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 anImmersiveConfigScreenInfoinstance.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 anImmersiveConfigScreenInfoinstance.static voiddoImmersiveRegistration(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:ImmersiveMCClientRegistrationCreates anImmersiveConfigScreenInfoinstance. See the aforementioned interface for more information.- Specified by:
createConfigScreenInfoOneItemin 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
ImmersiveConfigScreenInfoinstance.
-
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:ImmersiveMCClientRegistrationCreates anImmersiveConfigScreenInfoinstance. See the aforementioned interface for more information.- Specified by:
createConfigScreenInfoMultipleItemsin 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
ImmersiveConfigScreenInfoinstance.
-
addImmersiveRegistrationHandler
public void addImmersiveRegistrationHandler(Consumer<ImmersiveMCRegistrationEvent<Immersive<?, ?>>> registrationHandler) throws IllegalStateExceptionDescription copied from interface:ImmersiveMCClientRegistrationRegisters an object which, at some point, ImmersiveMC will call to register yourImmersivess. 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:
addImmersiveRegistrationHandlerin interfaceImmersiveMCClientRegistration- Parameters:
registrationHandler- Your object that will register Immersives when called.- Throws:
IllegalStateException- This method was called after registration.
-