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

public class BuildingStatisticsModule extends AbstractBuildingModule implements IPersistentModule
Building statistic module.
  • Constructor Details

    • BuildingStatisticsModule

      public BuildingStatisticsModule()
  • Method Details

    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Deserialize the module.
      Specified by:
      deserializeNBT in interface IPersistentModule
      Parameters:
      compound - the nbt compound.
    • serializeNBT

      public void serializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Serialize the module from a compound.
      Specified by:
      serializeNBT in interface IPersistentModule
      Parameters:
      compound - the compound.
    • serializeToView

      public void serializeToView(net.minecraft.network.FriendlyByteBuf buf, boolean fullSync)
      Description copied from interface: IBuildingModule
      Serialization method to send the module data to the client side.
      Specified by:
      serializeToView in interface IBuildingModule
      Parameters:
      buf - the buffer to write it to.
      fullSync - whether we need to sync the full data
    • getBuildingStatisticsManager

      public IStatisticsManager getBuildingStatisticsManager()
      Get the statistic manager of the building.
      Returns:
      the manager.
    • increment

      public void increment(String s)
      Helper method for incrementation of the stats.
      Parameters:
      s - the stat id to increment.
    • incrementBy

      public void incrementBy(String s, int count)
      Helper method for incrementation of the stats by a count.
      Parameters:
      s - the stat id to increment.
      count - the count to increment it by.