MCPcopy Create free account
hub / github.com/Garten/sourcecraft / World

Method World

src/main/World.java:34–48  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

32 private LabeledCoordinates worldSpawnPosition;
33
34 public World(String name) throws IOException {
35 this.name = name;
36 File file = new File(Periphery.CONFIG.getWorldPath(this), WORLD_LEVEL_DAT_NAME);
37 Position player = new Position();
38 Position worldSpawn = new Position();
39 DataInputStream stream = new DataInputStream(new GZIPInputStream(new FileInputStream(file)));
40 PlayerInLevelReader reader = new PlayerInLevelReader(stream);
41 reader.read();
42 player = reader.getPlayerPosition();
43 worldSpawn = reader.getWorldSpawn();
44 this.playerPosition = new LabeledCoordinates(PLAYER_POSITION, player, player);
45 this.worldSpawnPosition = new LabeledCoordinates("World spawn", worldSpawn, worldSpawn);
46 this.playerPosition.enlarge(new Position(-20, -30, -20), new Position(20, 30, 20));
47 this.worldSpawnPosition.enlarge(new Position(-20, -30, -20), new Position(20, 30, 20));
48 }
49
50 @Override
51 public String toString() {

Callers

nothing calls this directly

Calls 5

readMethod · 0.95
getPlayerPositionMethod · 0.95
getWorldSpawnMethod · 0.95
getWorldPathMethod · 0.80
enlargeMethod · 0.80

Tested by

no test coverage detected