Class FurnaceUserModule
java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.FurnaceUserModule
- All Implemented Interfaces:
IAltersRequiredItems,IBuildingModule,IModuleWithExternalBlocks,IPersistentModule,IHasDirty
public class FurnaceUserModule
extends AbstractBuildingModule
implements IPersistentModule, IModuleWithExternalBlocks, IAltersRequiredItems
Module for all workers that need a furnace.
-
Field Summary
Fields inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
building, isDirty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidalterItemsToBeKept(org.apache.logging.log4j.util.TriConsumer<Predicate<net.minecraft.world.item.ItemStack>, Integer, Boolean> consumer) Check if additional items have to be kept and add to map if necessary.voiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Deserialize the module.List<net.minecraft.core.BlockPos> Return a list of furnaces assigned to this hut.List<net.minecraft.core.BlockPos> Get the list of registered blocks.booleanisAllowedFuel(net.minecraft.world.item.ItemStack stack) Check if an ItemStack is one of the accepted fuel items.voidonBlockPlacedInBuilding(@NotNull net.minecraft.world.level.block.state.BlockState blockState, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.Level world) Attempt to register a specific block at a specific module.voidremoveFromFurnaces(net.minecraft.core.BlockPos pos) Remove a furnace from the building.voidserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Serialize the module from a compound.Methods inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
checkDirty, clearDirty, getBuilding, getProducer, markDirty, setBuilding, setProducerMethods 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.IBuildingModule
getBuilding, getProducer, serializeToView, serializeToView, setBuilding, setProducerMethods inherited from interface com.minecolonies.api.util.IHasDirty
checkDirty, clearDirty, markDirty
-
Constructor Details
-
FurnaceUserModule
public FurnaceUserModule()Construct a new furnace user module.
-
-
Method Details
-
deserializeNBT
public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Description copied from interface:IPersistentModuleDeserialize the module.- Specified by:
deserializeNBTin interfaceIPersistentModule- Parameters:
compound- the nbt compound.
-
serializeNBT
public void serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Description copied from interface:IPersistentModuleSerialize the module from a compound.- Specified by:
serializeNBTin interfaceIPersistentModule- Parameters:
compound- the compound.
-
alterItemsToBeKept
public void alterItemsToBeKept(org.apache.logging.log4j.util.TriConsumer<Predicate<net.minecraft.world.item.ItemStack>, Integer, Boolean> consumer) Description copied from interface:IAltersRequiredItemsCheck if additional items have to be kept and add to map if necessary.- Specified by:
alterItemsToBeKeptin interfaceIAltersRequiredItems- Parameters:
consumer- consumer that adds items to it.
-
removeFromFurnaces
public void removeFromFurnaces(net.minecraft.core.BlockPos pos) Remove a furnace from the building.- Parameters:
pos- the position of it.
-
isAllowedFuel
public boolean isAllowedFuel(net.minecraft.world.item.ItemStack stack) Check if an ItemStack is one of the accepted fuel items.- Parameters:
stack- the itemStack to check.- Returns:
- true if so.
-
getFurnaces
Return a list of furnaces assigned to this hut.- Returns:
- copy of the list
-
onBlockPlacedInBuilding
public void onBlockPlacedInBuilding(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.Level world) Description copied from interface:IModuleWithExternalBlocksAttempt to register a specific block at a specific module.- Specified by:
onBlockPlacedInBuildingin interfaceIModuleWithExternalBlocks- Parameters:
blockState- the state.pos- the position.world- the world.
-
getRegisteredBlocks
Description copied from interface:IModuleWithExternalBlocksGet the list of registered blocks.- Specified by:
getRegisteredBlocksin interfaceIModuleWithExternalBlocks- Returns:
- the list of positions of the blocks.
-