mirror of
https://github.com/trainerlord/WorldSystem.git
synced 2024-12-01 13:13:21 +01:00
Added test
This commit is contained in:
parent
41b5ed6bc2
commit
e117fda5e8
15
pom.xml
15
pom.xml
@ -40,6 +40,7 @@
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.3</version>
|
||||
@ -48,6 +49,7 @@
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@ -61,6 +63,19 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
@ -18,27 +18,24 @@ public class AsyncCreatorAdapter implements CreatorAdapter {
|
||||
// Create worlds async to close #16
|
||||
@Override
|
||||
public void create(WorldCreator creator, SystemWorld sw, Runnable r) {
|
||||
TaskManager.IMP.async(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
AsyncWorld world;
|
||||
if (Bukkit.getWorld(creator.name()) == null)
|
||||
world = AsyncWorld.create(creator);
|
||||
else
|
||||
world = AsyncWorld.wrap(Objects.requireNonNull(Bukkit.getWorld(creator.name())));
|
||||
TaskManager.IMP.async(() -> {
|
||||
AsyncWorld world;
|
||||
if (Bukkit.getWorld(creator.name()) == null)
|
||||
world = AsyncWorld.create(creator);
|
||||
else
|
||||
world = AsyncWorld.wrap(Objects.requireNonNull(Bukkit.getWorld(creator.name())));
|
||||
|
||||
Block block = world.getBlockAt(0, 0, 0);
|
||||
block.setType(Material.BEDROCK);
|
||||
|
||||
// When you are done
|
||||
world.commit();
|
||||
Bukkit.getWorlds().add(world);
|
||||
if (sw != null)
|
||||
sw.setCreating(false);
|
||||
|
||||
// Send the message
|
||||
r.run();
|
||||
}
|
||||
Block block = world.getBlockAt(0, 0, 0);
|
||||
block.setType(Material.BEDROCK);
|
||||
|
||||
// When you are done
|
||||
world.commit();
|
||||
Bukkit.getWorlds().add(world);
|
||||
if (sw != null)
|
||||
sw.setCreating(false);
|
||||
|
||||
// Send the message
|
||||
r.run();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
package de.butzlabben.world.wrapper;
|
||||
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class GeneratorSettingsTest {
|
||||
|
||||
@Test
|
||||
public void asWorldCreator() {
|
||||
GeneratorSettings settings = new GeneratorSettings();
|
||||
WorldCreator creator = settings.asWorldCreator("test");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user