Class BuildingExtensionDataManager

java.lang.Object
com.minecolonies.core.colony.buildingextensions.registry.BuildingExtensionDataManager

public final class BuildingExtensionDataManager extends Object
The building extension manager class responsible for creating building extension instances from NBT data, etc.
  • Method Details

    • compoundToExtension

      public static IBuildingExtension compoundToExtension(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Creates a building extension instance from NBT compound data.
      Parameters:
      compound - the input compound data.
      Returns:
      the created building extension instance.
    • resourceLocationToExtension

      public static IBuildingExtension resourceLocationToExtension(@NotNull @NotNull net.minecraft.resources.ResourceLocation registryName, @NotNull @NotNull net.minecraft.core.BlockPos position)
      Creates a building extension instance from a building extension type and position.
      Parameters:
      registryName - the building extension registry entry name.
      position - the position of the building extension.
      Returns:
      the building extension instance.
    • bufferToExtension

      public static IBuildingExtension bufferToExtension(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
      Creates a building extension instance from a complete network buffer.
      Parameters:
      buf - the buffer, still containing the building extension registry type and position.
      Returns:
      the building extension instance.
    • extensionToBuffer

      public static net.minecraft.network.RegistryFriendlyByteBuf extensionToBuffer(@NotNull @NotNull IBuildingExtension extension, @NotNull @NotNull net.minecraft.core.RegistryAccess provider)
      Creates a network buffer from a building extension instance.
      Parameters:
      extension - the building extension instance.
      Returns:
      the network buffer.
    • extensionToCompound

      public static net.minecraft.nbt.CompoundTag extensionToCompound(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull IBuildingExtension extension)
      Creates NBT compound data from a building extension instance.
      Parameters:
      extension - the building extension instance.
      Returns:
      the NBT compound.