Skip to content

Commit

Permalink
Cleaned up import system and implemented the ability to modify 'loadO…
Browse files Browse the repository at this point in the history
…nStartup' through API
  • Loading branch information
Swofty-Developments committed Oct 12, 2023
1 parent ac287f9 commit cd7db8d
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>net.swofty</groupId>
<artifactId>swoftyworldmanager</artifactId>
<packaging>pom</packaging>
<version>3.0.1</version>
<version>3.0.2</version>
<modules>
<module>swoftyworldmanager-api</module>
<module>swoftyworldmanager-nms-common</module>
Expand Down
2 changes: 1 addition & 1 deletion swoftyworldmanager-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>swoftyworldmanager</artifactId>
<groupId>net.swofty</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,10 @@ public class SlimeProperties {
* The default biome generated in empty chunks
*/
public static final SlimeProperty<String> DEFAULT_BIOME = new SlimePropertyString("defaultBiome", "minecraft:plains");


/**
* The default biome generated in empty chunks
*/
public static final SlimeProperty<Boolean> LOAD_ON_STARTUP = new SlimePropertyBoolean("loadOnStartup", true);
}
2 changes: 1 addition & 1 deletion swoftyworldmanager-classmodifier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>swoftyworldmanager</artifactId>
<groupId>net.swofty</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion swoftyworldmanager-importer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>swoftyworldmanager</artifactId>
<groupId>net.swofty</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swoftyworldmanager-importer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,6 @@ private static boolean isEmpty(byte[] array) {
return false;
}
}

return true;
}

private static boolean isEmpty(long[] array) {
for (long b : array) {
if (b != 0L) {
return false;
}
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion swoftyworldmanager-nms-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>swoftyworldmanager</artifactId>
<groupId>net.swofty</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion swoftyworldmanager-nms-v1_8_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>swoftyworldmanager</artifactId>
<groupId>net.swofty</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion swoftyworldmanager-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>swoftyworldmanager</artifactId>
<groupId>net.swofty</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swoftyworldmanager-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ public CompletableFuture<Void> generateWorld(SlimeWorld world) {
*/
worldGeneratorService.submit(() -> {
Object nmsWorld = nms.createNMSWorld(world);
System.out.println("TEST 6");
Bukkit.getScheduler().runTask(this, () -> {
nms.addWorldToServerList(nmsWorld);
future.complete(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,17 @@ public SlimePropertyMap toPropertyMap() {

SlimePropertyMap propertyMap = new SlimePropertyMap();

propertyMap.setInt(SlimeProperties.SPAWN_X, (int) spawnX);
propertyMap.setInt(SlimeProperties.SPAWN_Y, (int) spawnY);
propertyMap.setInt(SlimeProperties.SPAWN_Z, (int) spawnZ);

propertyMap.setString(SlimeProperties.DIFFICULTY, difficulty);
propertyMap.setBoolean(SlimeProperties.ALLOW_MONSTERS, allowMonsters);
propertyMap.setBoolean(SlimeProperties.ALLOW_ANIMALS, allowAnimals);
propertyMap.setBoolean(SlimeProperties.PVP, pvp);
propertyMap.setString(SlimeProperties.ENVIRONMENT, environment);
propertyMap.setString(SlimeProperties.WORLD_TYPE, worldType);
propertyMap.setValue(SlimeProperties.SPAWN_X, (int) spawnX);
propertyMap.setValue(SlimeProperties.SPAWN_Y, (int) spawnY);
propertyMap.setValue(SlimeProperties.SPAWN_Z, (int) spawnZ);

propertyMap.setValue(SlimeProperties.DIFFICULTY, difficulty);
propertyMap.setValue(SlimeProperties.ALLOW_MONSTERS, allowMonsters);
propertyMap.setValue(SlimeProperties.ALLOW_ANIMALS, allowAnimals);
propertyMap.setValue(SlimeProperties.PVP, pvp);
propertyMap.setValue(SlimeProperties.ENVIRONMENT, environment);
propertyMap.setValue(SlimeProperties.WORLD_TYPE, worldType);
propertyMap.setValue(SlimeProperties.LOAD_ON_STARTUP, loadOnStartup);

return propertyMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@RequiredArgsConstructor
public class LevelData {

private final int version; // Unused
private final Map<String, String> gameRules;

private final int spawnX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private static LevelData readLevelData(File file) throws IOException, InvalidWor
int spawnY = dataTag.get().getIntValue("SpawnY").orElse(255);
int spawnZ = dataTag.get().getIntValue("SpawnZ").orElse(0);

return new LevelData(dataVersion, gameRules, spawnX, spawnY, spawnZ);
return new LevelData(gameRules, spawnX, spawnY, spawnZ);
}
}

Expand Down

0 comments on commit cd7db8d

Please sign in to comment.