Re-Introduced HEIGHMAP mode correctly.

Added single get and add to the LevelContainer to avoid using temp arrays
This commit is contained in:
Leonardo
2021-09-15 13:23:41 +02:00
parent 6dc94b0cc2
commit cdeba2616c
13 changed files with 426 additions and 222 deletions
@@ -34,12 +34,26 @@ public class VerticalLevelContainer implements LevelContainer
return true;
}
public boolean addSingleData(long newData, int posX, int posZ){
posX = LevelPosUtil.getRegionModule(detailLevel, posX);
posZ = LevelPosUtil.getRegionModule(detailLevel, posZ);
dataContainer[posX][posZ][0] = newData;
return true;
}
public long[] getData(int posX, int posZ){
posX = LevelPosUtil.getRegionModule(detailLevel, posX);
posZ = LevelPosUtil.getRegionModule(detailLevel, posZ);
return dataContainer[posX][posZ];
}
public long getSingleData(int posX, int posZ){
posX = LevelPosUtil.getRegionModule(detailLevel, posX);
posZ = LevelPosUtil.getRegionModule(detailLevel, posZ);
//Improve this using a thread map to long[]
return dataContainer[posX][posZ][0];
}
public boolean doesItExist(int posX, int posZ){
long[] data = getData(posX,posZ);
if(data == null)