Archived
0

получение World по его имени

Суть в том, что ID бина - это и есть World.name
This commit is contained in:
2018-10-08 14:38:01 +03:00
parent 686d444906
commit 1ffbead1f6
6 changed files with 42 additions and 44 deletions

View File

@@ -1,7 +1,3 @@
/*
* DmitriyMX <dimon550@gmail.com>
* 2018-04-28
*/
package mc.world.simple;
import lombok.Getter;
@@ -12,13 +8,15 @@ import mc.core.world.World;
import mc.core.world.WorldType;
import mc.core.world.chunk.Chunk;
import mc.core.world.chunk.ChunkProvider;
import org.springframework.beans.factory.BeanNameAware;
import javax.annotation.Nonnull;
import java.util.List;
@Slf4j
public class SimpleWorld implements World {
public class SimpleWorld implements World, BeanNameAware {
@Getter
private final String name = "flat";
private String name;
@Getter
private final WorldType worldType = WorldType.FLAT;
private EntityLocation spawn;
@@ -60,4 +58,9 @@ public class SimpleWorld implements World {
((FlatChunkProvider)chunkProvider).setLayersBlock(listOfLayers);
}
}
@Override
public void setBeanName(@Nonnull String name) {
this.name = name;
}
}