MCPcopy Create free account
hub / github.com/cuberite/cuberite / Fill

Method Fill

src/BlockArea.cpp:805–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803
804
805void cBlockArea::Fill(int a_DataTypes, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, NIBBLETYPE a_BlockLight, NIBBLETYPE a_BlockSkyLight)
806{
807 if ((a_DataTypes & GetDataTypes()) != a_DataTypes)
808 {
809 LOGWARNING("%s: requested datatypes that are not present in the BlockArea object, trimming those away (req 0x%x, stor 0x%x)",
810 __FUNCTION__, a_DataTypes, GetDataTypes()
811 );
812 a_DataTypes = a_DataTypes & GetDataTypes();
813 }
814
815 int BlockCount = GetBlockCount();
816 if ((a_DataTypes & baTypes) != 0)
817 {
818 for (int i = 0; i < BlockCount; i++)
819 {
820 m_BlockTypes[i] = a_BlockType;
821 }
822 }
823 if ((a_DataTypes & baMetas) != 0)
824 {
825 for (int i = 0; i < BlockCount; i++)
826 {
827 m_BlockMetas[i] = a_BlockMeta;
828 }
829 }
830 if ((a_DataTypes & baLight) != 0)
831 {
832 for (int i = 0; i < BlockCount; i++)
833 {
834 m_BlockLight[i] = a_BlockLight;
835 }
836 }
837 if ((a_DataTypes & baSkyLight) != 0)
838 {
839 for (int i = 0; i < BlockCount; i++)
840 {
841 m_BlockSkyLight[i] = a_BlockSkyLight;
842 }
843 }
844}
845
846
847

Callers 2

CreateLakeImageMethod · 0.45
FillBlocksMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected