Class BuildingDataManager
java.lang.Object
com.minecolonies.core.colony.buildings.registry.BuildingDataManager
- All Implemented Interfaces:
IBuildingDataManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFrom(IColony colony, AbstractTileEntityColonyBuilding tileEntityColonyBuilding) Creates a new entry from a givenIColonyand the data passed in asAbstractTileEntityColonyBuilding.createFrom(IColony colony, net.minecraft.core.BlockPos position, net.minecraft.resources.ResourceLocation buildingName) Creates a new entry from a givenIColonyand the data passed in asAbstractTileEntityColonyBuilding.createFrom(IColony colony, net.minecraft.nbt.CompoundTag compound) Creates a new entry from a givenIColonyand the data passed in asCompoundTag.createViewFrom(IColonyView colony, net.minecraft.core.BlockPos position, net.minecraft.network.FriendlyByteBuf networkBuffer) Creates a new entry from a givenIColonyView, the position asBlockPosand the data passed in asByteBuf.voidopenBuildingBrowser(@NotNull net.minecraft.world.level.block.Block block) Opens the building browser window for the specific building type.
-
Constructor Details
-
BuildingDataManager
public BuildingDataManager()
-
-
Method Details
-
createFrom
Description copied from interface:IBuildingDataManagerCreates a new entry from a givenIColonyand the data passed in asCompoundTag.- Specified by:
createFromin interfaceIBuildingDataManager- Parameters:
colony- TheIColonyto which the newIBuildingbelongs.compound- The data from which to load newIBuildingstored in aCompoundTag.- Returns:
- The
IBuildingwith the data loaded fromCompoundTag.
-
createFrom
public IBuilding createFrom(IColony colony, AbstractTileEntityColonyBuilding tileEntityColonyBuilding) Description copied from interface:IBuildingDataManagerCreates a new entry from a givenIColonyand the data passed in asAbstractTileEntityColonyBuilding.- Specified by:
createFromin interfaceIBuildingDataManager- Parameters:
colony- TheIColonyto which the newIBuildingbelongs.tileEntityColonyBuilding- The data from which to load newIBuildingstored in aAbstractTileEntityColonyBuilding.- Returns:
- The
IBuildingwith the data loaded fromAbstractTileEntityColonyBuilding.
-
createFrom
public IBuilding createFrom(IColony colony, net.minecraft.core.BlockPos position, net.minecraft.resources.ResourceLocation buildingName) Description copied from interface:IBuildingDataManagerCreates a new entry from a givenIColonyand the data passed in asAbstractTileEntityColonyBuilding.- Specified by:
createFromin interfaceIBuildingDataManager- Parameters:
colony- TheIColonyto which the newIBuildingbelongs.position- The position on which the newIBuildingis created.buildingName- The name of theIBuildingas registered to the registry.- Returns:
- The
IBuildingwith the data loaded fromAbstractTileEntityColonyBuilding.
-
createViewFrom
public IBuildingView createViewFrom(IColonyView colony, net.minecraft.core.BlockPos position, net.minecraft.network.FriendlyByteBuf networkBuffer) Description copied from interface:IBuildingDataManagerCreates a new entry from a givenIColonyView, the position asBlockPosand the data passed in asByteBuf.- Specified by:
createViewFromin interfaceIBuildingDataManager- Parameters:
colony- TheIColonyViewto which the newIBuildingViewbelongs.position- The position of the newIBuildingView.networkBuffer- The data from which to load the newIBuildingViewstored in the networksByteBuf.- Returns:
- The
IBuildingViewwith the data loaded from theByteBuf.
-
openBuildingBrowser
public void openBuildingBrowser(@NotNull @NotNull net.minecraft.world.level.block.Block block) Description copied from interface:IBuildingDataManagerOpens the building browser window for the specific building type. Client side only.- Specified by:
openBuildingBrowserin interfaceIBuildingDataManager- Parameters:
block- The building block.
-