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"> <project xmlns="http://maven.apache.org/POM/4.0.0"
<modelVersion>4.0.0</modelVersion> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<groupId>us.tastybento</groupId> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>addon-acidisland</artifactId> <modelVersion>4.0.0</modelVersion>
<version>0.0.1-SNAPSHOT</version> <groupId>us.tastybento</groupId>
<packaging>jar</packaging> <artifactId>addon-acidisland</artifactId>
<properties> <version>0.0.1-SNAPSHOT</version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <packaging>jar</packaging>
</properties> <properties>
<build> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<defaultGoal>clean package install</defaultGoal> </properties>
<resources> <build>
<resource> <defaultGoal>clean package install</defaultGoal>
<targetPath>.</targetPath> <resources>
<filtering>true</filtering> <resource>
<directory>${basedir}</directory> <targetPath>.</targetPath>
<includes> <filtering>true</filtering>
<include>*.yml</include> <directory>${basedir}</directory>
</includes> <includes>
</resource> <include>*.yml</include>
<resource> </includes>
<targetPath>locales</targetPath> </resource>
<filtering>false</filtering> <resource>
<directory>${basedir}/locales</directory> <targetPath>schems</targetPath>
<includes> <filtering>false</filtering>
<include>*.yml</include> <directory>${basedir}/schems</directory>
</includes> <includes>
</resource> <include>*.schem</include>
</resources> </includes>
</resource>
<resource>
<targetPath>locales</targetPath>
<filtering>false</filtering>
<directory>${basedir}/locales</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>3.5.1</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version> <version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>us.tastybento</groupId> <groupId>us.tastybento</groupId>
<artifactId>bskyblock</artifactId> <artifactId>bskyblock</artifactId>
<version>LATEST</version> <version>LATEST</version>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories> <repositories>
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository> </repository>
</repositories> </repositories>
</project> </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.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.Set; import java.util.Set;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@ -13,6 +14,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType; 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.ConfigComment;
import us.tastybento.bskyblock.api.configuration.ConfigEntry; import us.tastybento.bskyblock.api.configuration.ConfigEntry;
import us.tastybento.bskyblock.api.configuration.StoreAt; import us.tastybento.bskyblock.api.configuration.StoreAt;
@ -1453,4 +1455,9 @@ public class AISettings implements DataObject, WorldSettings {
this.closePanelOnClickOutside = closePanelOnClickOutside; 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.AcidCommand;
import bskyblock.addon.acidisland.commands.AiCommand; import bskyblock.addon.acidisland.commands.AiCommand;
import bskyblock.addon.acidisland.listeners.AcidEffect; import bskyblock.addon.acidisland.listeners.AcidEffect;
import bskyblock.addon.acidisland.listeners.IslandBuilder;
import bskyblock.addon.acidisland.listeners.LavaCheck; import bskyblock.addon.acidisland.listeners.LavaCheck;
import bskyblock.addon.acidisland.world.AcidIslandWorld; import bskyblock.addon.acidisland.world.AcidIslandWorld;
import bskyblock.addon.acidisland.world.AcidTask; import bskyblock.addon.acidisland.world.AcidTask;
@ -19,12 +18,14 @@ import us.tastybento.bskyblock.api.configuration.BSBConfig;
* *
*/ */
public class AcidIsland extends Addon { public class AcidIsland extends Addon {
private static AcidIsland addon;
private AISettings settings; private AISettings settings;
private AcidIslandWorld aiw; private AcidIslandWorld aiw;
@Override @Override
public void onLoad() { public void onLoad() {
addon = this;
saveDefaultConfig(); saveDefaultConfig();
// Load settings // Load settings
settings = new BSBConfig<>(this, AISettings.class).loadConfigObject(""); 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 AcidEffect(this), this.getBSkyBlock());
manager.registerEvents(new LavaCheck(this), this.getBSkyBlock()); manager.registerEvents(new LavaCheck(this), this.getBSkyBlock());
// New Islands // New Islands
manager.registerEvents(new IslandBuilder(this), this.getBSkyBlock()); //manager.registerEvents(new IslandBuilder(this), this.getBSkyBlock());
// Register commands // Register commands
new AcidCommand(this); new AcidCommand(this);
new AiCommand(this); new AiCommand(this);
@ -62,7 +63,7 @@ public class AcidIsland extends Addon {
public AcidIslandWorld getAiw() { public AcidIslandWorld getAiw() {
return aiw; return aiw;
} }
/** /**
* Convenience method to obtain the AcidIsland overworld * Convenience method to obtain the AcidIsland overworld
* @return Island World * @return Island World
@ -71,10 +72,13 @@ public class AcidIsland extends Addon {
return aiw.getOverWorld(); return aiw.getOverWorld();
} }
@Override
public void log(String string) { 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)) islandWorld = WorldCreator.name(worldName).type(WorldType.FLAT).environment(World.Environment.NORMAL).generator(new ChunkGeneratorWorld(addon))
.createWorld(); .createWorld();
addon.getBSkyBlock().registerWorld(islandWorld, addon.getSettings()); addon.getBSkyBlock().registerWorld(islandWorld, addon.getSettings());
// Make the nether if it does not exist // Make the nether if it does not exist
if (addon.getSettings().isNetherGenerate()) { if (addon.getSettings().isNetherGenerate()) {
if (addon.getServer().getWorld(worldName + NETHER) == null) { if (addon.getServer().getWorld(worldName + NETHER) == null) {
@ -58,6 +59,10 @@ public class AcidIslandWorld {
.environment(World.Environment.THE_END).createWorld(); .environment(World.Environment.THE_END).createWorld();
} }
} }
// Load schematics
addon.getBSkyBlock().getSchemsManager().loadIslands(islandWorld);
} }