Archived
0

Interfaces implementations

This commit is contained in:
Forwolk
2018-08-02 09:25:47 +03:00
parent f55c9bfb33
commit ef383b6e13
2 changed files with 37 additions and 0 deletions

View File

@@ -1,10 +1,14 @@
package mc.world.generated_world;
import com.flowpowered.nbt.Tag;
import lombok.Getter;
import mc.core.Location;
import mc.core.world.*;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Stream;
public class CubicWorld implements World {
@Getter
@@ -13,6 +17,7 @@ public class CubicWorld implements World {
private volatile Location spawnLocation;
private final transient Object spawnLocationLock = new Object();
private final transient ChunkLoader chunkLoader;
private final Map<String, Tag<?>> nbtTagMap = new HashMap<>();
public CubicWorld(UUID worldId, int seed) {
this.worldId = worldId;
@@ -86,4 +91,19 @@ public class CubicWorld implements World {
public int getSeed() {
return seed;
}
@Override
public Tag<?> getTag(String name) {
return nbtTagMap.get(name);
}
@Override
public void setTag(Tag<?> tag) {
nbtTagMap.put(tag.getName(), tag);
}
@Override
public Stream<Tag<?>> tagStream() {
return nbtTagMap.values().stream();
}
}