Class SettingsFactories.AbstractBoolSettingFactory<T extends BoolSetting>
java.lang.Object
com.minecolonies.core.colony.buildings.modules.settings.SettingsFactories.AbstractBoolSettingFactory<T>
- All Implemented Interfaces:
IBoolSettingFactory<T>,IFactory<FactoryVoidInput,T>
- Direct Known Subclasses:
SettingsFactories.BoolSettingFactory
- Enclosing class:
- SettingsFactories
public abstract static class SettingsFactories.AbstractBoolSettingFactory<T extends BoolSetting>
extends Object
implements IBoolSettingFactory<T>
Specific factory for the bool setting.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(@NotNull IFactoryController controller, @NotNull net.minecraft.nbt.CompoundTag nbt) Method to deserialize a given constructable.deserialize(@NotNull IFactoryController controller, @NotNull net.minecraft.network.FriendlyByteBuf buffer) Method to deserialize a given constructable.@NotNull com.google.common.reflect.TypeToken<FactoryVoidInput>Used to determine which type this can produce.@NotNull net.minecraft.nbt.CompoundTagserialize(@NotNull IFactoryController controller, T storage) Method to serialize a given constructable.voidserialize(@NotNull IFactoryController controller, T input, @NotNull net.minecraft.network.FriendlyByteBuf packetBuffer) Method to serialize a given constructable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.modules.settings.IBoolSettingFactory
getNewInstance, getNewInstanceMethods inherited from interface com.minecolonies.api.colony.requestsystem.factory.IFactory
getFactoryOutputType, getSerializationId
-
Constructor Details
-
AbstractBoolSettingFactory
public AbstractBoolSettingFactory()
-
-
Method Details
-
getFactoryInputType
@NotNull public @NotNull com.google.common.reflect.TypeToken<FactoryVoidInput> getFactoryInputType()Description copied from interface:IFactoryUsed to determine which type this can produce.- Specified by:
getFactoryInputTypein interfaceIFactory<FactoryVoidInput,T extends BoolSetting> - Returns:
- The class that represents the Type of Request this can produce.
-
deserialize
@NotNull public T deserialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.nbt.CompoundTag nbt) Description copied from interface:IFactoryMethod to deserialize a given constructable.- Specified by:
deserializein interfaceIFactory<FactoryVoidInput,T extends BoolSetting> - Parameters:
controller- The controller that can be used to deserialize complicated types.nbt- The data of the request that should be deserialized.- Returns:
- The request that corresponds with the given data in the nbt
-
serialize
@NotNull public @NotNull net.minecraft.nbt.CompoundTag serialize(@NotNull @NotNull IFactoryController controller, @NotNull T storage) Description copied from interface:IFactoryMethod to serialize a given constructable.- Specified by:
serializein interfaceIFactory<FactoryVoidInput,T extends BoolSetting> - Parameters:
controller- The controller that can be used to serialize complicated types.storage- The request to serialize.- Returns:
- The serialized data of the given requets.
-
serialize
public void serialize(@NotNull @NotNull IFactoryController controller, @NotNull T input, @NotNull @NotNull net.minecraft.network.FriendlyByteBuf packetBuffer) Description copied from interface:IFactoryMethod to serialize a given constructable.- Specified by:
serializein interfaceIFactory<FactoryVoidInput,T extends BoolSetting> - Parameters:
controller- The controller that can be used to serialize complicated types.input- The request to serialize.packetBuffer- The buffer to serialize into.
-
deserialize
@NotNull public T deserialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.network.FriendlyByteBuf buffer) throws Throwable Description copied from interface:IFactoryMethod to deserialize a given constructable.- Specified by:
deserializein interfaceIFactory<FactoryVoidInput,T extends BoolSetting> - Parameters:
controller- The controller that can be used to deserialize complicated types.buffer- The data buffer of the request that should be deserialized.- Returns:
- The request that corresponds with the given data in the nbt
- Throws:
Exception- if somethings goes wrong during the deserialization.Throwable
-