Updated to use schems.

This commit is contained in:
tastybento 2018-07-02 21:57:56 -07:00
parent e47fb98cdc
commit 19bd6a0e6a
7 changed files with 91 additions and 65 deletions

128
pom.xml
View File

@ -1,61 +1,71 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>us.tastybento</groupId>
<artifactId>addon-acidisland</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<defaultGoal>clean package install</defaultGoal>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
<resource>
<targetPath>locales</targetPath>
<filtering>false</filtering>
<directory>${basedir}/locales</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>us.tastybento</groupId>
<artifactId>addon-acidisland</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<defaultGoal>clean package install</defaultGoal>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
<resource>
<targetPath>schems</targetPath>
<filtering>false</filtering>
<directory>${basedir}/schems</directory>
<includes>
<include>*.schem</include>
</includes>
</resource>
<resource>
<targetPath>locales</targetPath>
<filtering>false</filtering>
<directory>${basedir}/locales</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>us.tastybento</groupId>
<artifactId>bskyblock</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>us.tastybento</groupId>
<artifactId>bskyblock</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
</project>

BIN
schems/end-island.schem Normal file

Binary file not shown.

BIN
schems/island.schem Normal file

Binary file not shown.

BIN
schems/nether-island.schem Normal file

Binary file not shown.

View File

@ -6,6 +6,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.bukkit.GameMode;
@ -13,6 +14,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import us.tastybento.bskyblock.api.addons.Addon;
import us.tastybento.bskyblock.api.configuration.ConfigComment;
import us.tastybento.bskyblock.api.configuration.ConfigEntry;
import us.tastybento.bskyblock.api.configuration.StoreAt;
@ -1453,4 +1455,9 @@ public class AISettings implements DataObject, WorldSettings {
this.closePanelOnClickOutside = closePanelOnClickOutside;
}
@Override
public Optional<Addon> getAddon() {
return Optional.of(AcidIsland.getInstance());
}
}

View File

@ -6,7 +6,6 @@ import org.bukkit.plugin.PluginManager;
import bskyblock.addon.acidisland.commands.AcidCommand;
import bskyblock.addon.acidisland.commands.AiCommand;
import bskyblock.addon.acidisland.listeners.AcidEffect;
import bskyblock.addon.acidisland.listeners.IslandBuilder;
import bskyblock.addon.acidisland.listeners.LavaCheck;
import bskyblock.addon.acidisland.world.AcidIslandWorld;
import bskyblock.addon.acidisland.world.AcidTask;
@ -19,12 +18,14 @@ import us.tastybento.bskyblock.api.configuration.BSBConfig;
*
*/
public class AcidIsland extends Addon {
private static AcidIsland addon;
private AISettings settings;
private AcidIslandWorld aiw;
@Override
public void onLoad() {
addon = this;
saveDefaultConfig();
// Load settings
settings = new BSBConfig<>(this, AISettings.class).loadConfigObject("");
@ -40,7 +41,7 @@ public class AcidIsland extends Addon {
manager.registerEvents(new AcidEffect(this), this.getBSkyBlock());
manager.registerEvents(new LavaCheck(this), this.getBSkyBlock());
// New Islands
manager.registerEvents(new IslandBuilder(this), this.getBSkyBlock());
//manager.registerEvents(new IslandBuilder(this), this.getBSkyBlock());
// Register commands
new AcidCommand(this);
new AiCommand(this);
@ -62,7 +63,7 @@ public class AcidIsland extends Addon {
public AcidIslandWorld getAiw() {
return aiw;
}
/**
* Convenience method to obtain the AcidIsland overworld
* @return Island World
@ -71,10 +72,13 @@ public class AcidIsland extends Addon {
return aiw.getOverWorld();
}
@Override
public void log(String string) {
getBSkyBlock().log(string);
getBSkyBlock().log(string);
}
public static AcidIsland getInstance() {
return addon;
}
}

View File

@ -34,6 +34,7 @@ public class AcidIslandWorld {
islandWorld = WorldCreator.name(worldName).type(WorldType.FLAT).environment(World.Environment.NORMAL).generator(new ChunkGeneratorWorld(addon))
.createWorld();
addon.getBSkyBlock().registerWorld(islandWorld, addon.getSettings());
// Make the nether if it does not exist
if (addon.getSettings().isNetherGenerate()) {
if (addon.getServer().getWorld(worldName + NETHER) == null) {
@ -58,6 +59,10 @@ public class AcidIslandWorld {
.environment(World.Environment.THE_END).createWorld();
}
}
// Load schematics
addon.getBSkyBlock().getSchemsManager().loadIslands(islandWorld);
}