Class BuildingExtensionDataManager
java.lang.Object
com.minecolonies.core.colony.buildingextensions.registry.BuildingExtensionDataManager
The building extension manager class responsible for creating building extension instances from NBT data, etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IBuildingExtensionbufferToExtension(@NotNull net.minecraft.network.FriendlyByteBuf buf) Creates a building extension instance from a complete network buffer.static IBuildingExtensioncompoundToExtension(@NotNull net.minecraft.nbt.CompoundTag compound) Creates a building extension instance from NBT compound data.static net.minecraft.network.FriendlyByteBufextensionToBuffer(@NotNull IBuildingExtension extension) Creates a network buffer from a building extension instance.static net.minecraft.nbt.CompoundTagextensionToCompound(@NotNull IBuildingExtension extension) Creates NBT compound data from a building extension instance.static IBuildingExtensionresourceLocationToExtension(@NotNull net.minecraft.resources.ResourceLocation registryName, @NotNull net.minecraft.core.BlockPos position) Creates a building extension instance from a building extension type and position.
-
Method Details
-
compoundToExtension
public static IBuildingExtension compoundToExtension(@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.FriendlyByteBuf 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.FriendlyByteBuf extensionToBuffer(@NotNull @NotNull IBuildingExtension extension) 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 @NotNull IBuildingExtension extension) Creates NBT compound data from a building extension instance.- Parameters:
extension- the building extension instance.- Returns:
- the NBT compound.
-