Class StandardRequestFactories.BurnableRequestFactory
java.lang.Object
com.minecolonies.core.colony.requestsystem.requests.StandardRequestFactories.BurnableRequestFactory
- All Implemented Interfaces:
IFactory<Burnable,,StandardRequests.BurnableRequest> IRequestFactory<Burnable,StandardRequests.BurnableRequest>
- Enclosing class:
StandardRequestFactories
public static final class StandardRequestFactories.BurnableRequestFactory
extends Object
implements IRequestFactory<Burnable,StandardRequests.BurnableRequest>
-
Field Summary
Fields inherited from interface com.minecolonies.api.colony.requestsystem.request.IRequestFactory
NUMBER_OF_PROPERTIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer) Method to deserialize a given constructable.deserialize(net.minecraft.core.HolderLookup.Provider provider, @NotNull IFactoryController controller, @NotNull net.minecraft.nbt.CompoundTag nbt) Method to deserialize a given constructable.@NotNull com.google.common.reflect.TypeToken<? extends Burnable> Used to determine which type this can produce.@NotNull com.google.common.reflect.TypeToken<? extends StandardRequests.BurnableRequest> Method to get the type this factory can produce.getNewInstance(@NotNull Burnable input, @NotNull IRequester location, @NotNull IToken<?> token, @NotNull RequestState initialState) Method to get a new instance of a request given the input and token.shortGet a serialization id for the factory.voidserialize(IFactoryController controller, StandardRequests.BurnableRequest input, net.minecraft.network.RegistryFriendlyByteBuf packetBuffer) Method to serialize a given constructable.@NotNull net.minecraft.nbt.CompoundTagserialize(net.minecraft.core.HolderLookup.Provider provider, @NotNull IFactoryController controller, StandardRequests.BurnableRequest request) 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.requestsystem.request.IRequestFactory
getNewInstance, getNewInstance
-
Constructor Details
-
BurnableRequestFactory
public BurnableRequestFactory()
-
-
Method Details
-
getNewInstance
public StandardRequests.BurnableRequest getNewInstance(@NotNull @NotNull Burnable input, @NotNull @NotNull IRequester location, @NotNull @NotNull IToken<?> token, @NotNull @NotNull RequestState initialState) Description copied from interface:IRequestFactoryMethod to get a new instance of a request given the input and token.- Specified by:
getNewInstancein interfaceIRequestFactory<Burnable,StandardRequests.BurnableRequest> - Parameters:
input- The input to build a new request for.location- the location of the requester.token- The token to build the request from.initialState- The initial state of the request request.- Returns:
- The new output instance for a given input.
-
getFactoryOutputType
@NotNull public @NotNull com.google.common.reflect.TypeToken<? extends StandardRequests.BurnableRequest> getFactoryOutputType()Description copied from interface:IFactoryMethod to get the type this factory can produce.- Specified by:
getFactoryOutputTypein interfaceIFactory<Burnable,StandardRequests.BurnableRequest> - Returns:
- The type of request this factory can produce.
-
getFactoryInputType
@NotNull public @NotNull com.google.common.reflect.TypeToken<? extends Burnable> getFactoryInputType()Description copied from interface:IFactoryUsed to determine which type this can produce.- Specified by:
getFactoryInputTypein interfaceIFactory<Burnable,StandardRequests.BurnableRequest> - Returns:
- The class that represents the Type of Request this can produce.
-
serialize
@NotNull public @NotNull net.minecraft.nbt.CompoundTag serialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull IFactoryController controller, @NotNull StandardRequests.BurnableRequest request) Description copied from interface:IFactoryMethod to serialize a given constructable.- Specified by:
serializein interfaceIFactory<Burnable,StandardRequests.BurnableRequest> - Parameters:
controller- The controller that can be used to serialize complicated types.request- The request to serialize.- Returns:
- The serialized data of the given requets.
-
deserialize
@NotNull public StandardRequests.BurnableRequest deserialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, @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<Burnable,StandardRequests.BurnableRequest> - 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
public void serialize(IFactoryController controller, StandardRequests.BurnableRequest input, net.minecraft.network.RegistryFriendlyByteBuf packetBuffer) Description copied from interface:IFactoryMethod to serialize a given constructable.- Specified by:
serializein interfaceIFactory<Burnable,StandardRequests.BurnableRequest> - Parameters:
controller- The controller that can be used to serialize complicated types.input- The request to serialize.packetBuffer- The buffer to serialize into.
-
deserialize
public StandardRequests.BurnableRequest deserialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer) throws Throwable Description copied from interface:IFactoryMethod to deserialize a given constructable.- Specified by:
deserializein interfaceIFactory<Burnable,StandardRequests.BurnableRequest> - 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:
Throwable
-
getSerializationId
public short getSerializationId()Description copied from interface:IFactoryGet a serialization id for the factory.- Specified by:
getSerializationIdin interfaceIFactory<Burnable,StandardRequests.BurnableRequest> - Returns:
- the short id.
-