Skip to content

Commit

Permalink
1.4.0-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim W committed Jun 24, 2020
1 parent c2285cc commit b27d37a
Show file tree
Hide file tree
Showing 18 changed files with 378 additions and 28 deletions.
11 changes: 11 additions & 0 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>tim03we.futureplots</groupId>
<artifactId>FuturePlots</artifactId>
<version>1.3.2.1-SNAPSHOT</version>
<version>1.4.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -51,6 +51,12 @@
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ru.nukkit.dblib</groupId>
<artifactId>DbLib</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cn.nukkit</groupId>
<artifactId>redstone</artifactId>
Expand Down
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>tim03we.futureplots</groupId>
<artifactId>FuturePlots</artifactId>
<version>1.3.2.1-SNAPSHOT</version>
<version>1.4.0-SNAPSHOT</version>
<packaging>jar</packaging>
<repositories>
<repository>
Expand Down Expand Up @@ -38,6 +38,17 @@
<scope>system</scope>
<systemPath>${basedir}/libs/redstone.jar</systemPath>
</dependency>
<dependency>
<groupId>ru.nukkit.dblib</groupId>
<artifactId>DbLib</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/tim03we/futureplots/FuturePlots.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class FuturePlots extends PluginBase {
public void onLoad() {
instance = this;
providerClass.put("yaml", YamlProvider.class);
providerClass.put("mysql", MySQLProvider.class);
registerGenerator();
}

Expand Down Expand Up @@ -93,7 +94,7 @@ private void checkVersion() {
Language.init();
}
}
if(!getConfig().getString("version").equals("1.1.0")) {
if(!getConfig().getString("version").equals("1.2.0")) {
new File(getDataFolder() + "/config_old.yml").delete();
if(new File(getDataFolder() + "/config.yml").renameTo(new File(getDataFolder() + "/config_old.yml"))) {
getLogger().critical("The version of the configuration does not match. You will find the old file marked \"config_old.yml\" in the same directory.");
Expand All @@ -115,13 +116,14 @@ public void onDisable() {
}

private void initProvider() {
Class<?> providerClass = this.providerClass.get((this.getConfig().get(Settings.provider, "yaml")).toLowerCase());
Class<?> providerClass = this.providerClass.get(this.getConfig().getString("provider"));
if (providerClass == null) { this.getLogger().critical("The specified provider could not be found."); }
try { this.provider = (DataProvider) providerClass.newInstance();
try { provider = (DataProvider) providerClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) { this.getLogger().critical("The specified provider could not be found.");
getServer().getPluginManager().disablePlugin(getServer().getPluginManager().getPlugin("FuturePlots"));
return;
}
provider.connect();
if(Settings.economy) {
try {
if(getServer().getPluginManager().getPlugin("EconomyAPI") != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void execute(CommandSender sender, String command, String[] args) {
Plot plot = new PlotPlayer((Player) sender).getPlot();
if(plot != null) {
sender.sendMessage(translate(false, "plot.info.title"));
if(FuturePlots.provider.getOwner(plot) != null) {
if(FuturePlots.provider.hasOwner(plot)) {
sender.sendMessage(translate(false, "plot.info.text", FuturePlots.provider.getOwner(plot), plot.getX() + ";" + plot.getZ(), FuturePlots.provider.getHelpers(plot).toString(), FuturePlots.provider.getDenied(plot).toString(), FuturePlots.provider.getMembers(plot).toString()));
} else {
sender.sendMessage(translate(false, "plot.info.text", "[]", "[]", "[]", "[]", "[]"));
Expand Down

0 comments on commit b27d37a

Please sign in to comment.