Saving works again

This commit is contained in:
Leonardo
2021-09-13 01:47:04 +02:00
parent 95d9c17e49
commit 76a7baeb32
3 changed files with 6 additions and 4 deletions
@@ -9,7 +9,7 @@ import java.util.concurrent.ConcurrentMap;
public interface LevelContainer
{
public static final char VERTICAL_DATA_DELIMITER = '\t';
public static final char DATA_DELIMITER = '\n';
public static final char DATA_DELIMITER = ' ';
/**With this you can add data to the level container
*
* @param data actual data to add in a array of long format.
@@ -77,13 +77,15 @@ public class SingleLevelContainer implements LevelContainer
newData = 0;
for(tempIndex = 0; tempIndex < 16; tempIndex++)
{
if(index+tempIndex >= inputString.length())
break;
currentChar = inputString.charAt(index+tempIndex);
if(currentChar == ','){
if(currentChar == DATA_DELIMITER){
break;
}
shift = (15-tempIndex)*4;
digit = Character.digit(currentChar,16);
newData += ((long) (digit & 0xf)) << shift;
newData += ((((long) digit & 0xf)) << shift);
}
newData = newData >>> (shift);
data[x][z] = newData;