Class BuildingStatisticsModule
java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.BuildingStatisticsModule
- All Implemented Interfaces:
IBuildingModule,IPersistentModule,IHasDirty
- Direct Known Subclasses:
BarracksStatisticsModule
Building statistic module.
-
Field Summary
Fields inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
building, isDirty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Deserialize the module.Get the statistic manager of the building.voidHelper method for incrementation of the stats.voidincrementBy(String s, int count) Helper method for incrementation of the stats by a count.voidserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Serialize the module from a compound.voidserializeToView(net.minecraft.network.RegistryFriendlyByteBuf buf, boolean fullSync) Serialization method to send the module data to the client side.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, setBuilding, setProducerMethods inherited from interface com.minecolonies.api.util.IHasDirty
checkDirty, clearDirty, markDirty
-
Constructor Details
-
BuildingStatisticsModule
public BuildingStatisticsModule()
-
-
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.
-
serializeToView
public void serializeToView(net.minecraft.network.RegistryFriendlyByteBuf buf, boolean fullSync) Description copied from interface:IBuildingModuleSerialization method to send the module data to the client side.- Specified by:
serializeToViewin interfaceIBuildingModule- Parameters:
buf- the buffer to write it to.fullSync- whether we need to sync the full data
-
getBuildingStatisticsManager
Get the statistic manager of the building.- Returns:
- the manager.
-
increment
Helper method for incrementation of the stats.- Parameters:
s- the stat id to increment.
-
incrementBy
Helper method for incrementation of the stats by a count.- Parameters:
s- the stat id to increment.count- the count to increment it by.
-