Skip to content

Commit

Permalink
INI files again
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Fedin committed Nov 26, 2016
1 parent 8c7d838 commit 77f405b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/test/java/TestReadWrite.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Created by amorphine on 23.11.16.
*/

import org.ini4j.Ini;
import org.junit.Test;
import ru.wpstuio.amorphine.mcaliases.Chunk;
import ru.wpstuio.amorphine.mcaliases.Region;
Expand All @@ -21,7 +22,14 @@ public void testAdd() {
byte id_to_make = 26;

try {
world = new World(new File ("/home/amorphine/mine-thermos/world/region"));

//initializing path to region folder
String presets_url = TestReadWrite.class.getClassLoader().getResource("local_presets.ini").getPath();
Ini ini = new Ini(new File(presets_url));
String path_to_mca_folder = ini.get("paths", "world_path", String.class);


world = new World(new File (path_to_mca_folder));
Region rg = world.getRegion(-1, 0);

Coordinates2d chunk_cords = new Coordinates2d(31, 0);
Expand All @@ -30,7 +38,7 @@ public void testAdd() {
chunk.changeBlockId(-3, 64,6, id_to_make);
rg.saveChunk(chunk);

world = new World(new File ("/home/amorphine/mine-thermos/world/region"));
world = new World(new File (path_to_mca_folder));
rg = world.getRegion(-1, 0);
chunk = rg.getChunk(chunk_cords);
byte id = chunk.getBlockId(-3, 64,6);
Expand Down

0 comments on commit 77f405b

Please sign in to comment.