Fixes Issue #211

This commit is contained in:
Fuzzlemann 2017-08-01 17:19:23 +02:00
parent c88e7dae2f
commit 8aea50ee6c
4 changed files with 14 additions and 7 deletions

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.djrapitops:PlanPluginBridge:3.5.0">
<library name="Maven: com.djrapitops:PlanPluginBridge:3.6.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/PlanPluginBridge/3.5.0/PlanPluginBridge-3.5.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/PlanPluginBridge/3.6.0/PlanPluginBridge-3.6.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/PlanPluginBridge/3.5.0/PlanPluginBridge-3.5.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/PlanPluginBridge/3.6.0/PlanPluginBridge-3.6.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/PlanPluginBridge/3.5.0/PlanPluginBridge-3.5.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/PlanPluginBridge/3.6.0/PlanPluginBridge-3.6.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>
<artifactId>Plan</artifactId>
<version>3.5.5</version>
<version>3.6.0</version>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<defaultGoal>clean package install</defaultGoal>
@ -12,6 +12,8 @@
<targetPath>.</targetPath>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>*.keystore</include>
<include>*.js</include>
<include>*.yml</include>
<include>*.html</include>
</includes>
@ -178,6 +180,7 @@
</dependency>
</dependencies>
<properties>
<sonar.language>java</sonar.language>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>

View File

@ -25,6 +25,7 @@ public class PluginConfigSectionHandler {
if (!section.contains(pluginName)) {
return false;
}
ConfigurationSection pluginSection = section.getConfigurationSection(pluginName);
return pluginSection.contains(dataSource.getPlaceholder(""));
}
@ -38,8 +39,10 @@ public class PluginConfigSectionHandler {
ConfigurationSection section = getPluginsSection();
String pluginName = dataSource.getSourcePlugin();
String source = dataSource.placeholder;
section.addDefault(pluginName + ".Enabled", true);
section.addDefault(pluginName + ".Data." + source, true);
FileConfiguration config = plan.getConfig();
config.set("Customization.Plugins", section);
plan.saveConfig();
@ -47,9 +50,11 @@ public class PluginConfigSectionHandler {
public boolean isEnabled(PluginData dataSource) {
ConfigurationSection section = getPluginsSection();
String pluginName = dataSource.getSourcePlugin();
if (!section.getBoolean(pluginName + ".Enabled")) {
return false;
}
String source = dataSource.placeholder;
return section.getBoolean(pluginName + ".Data." + source);

View File

@ -16,7 +16,7 @@ import java.util.Map;
* <p>
* It caches all IPs with their matching country.
* <p>
* This cache uses the Google Guava {@link Cache} and has a capacity of 10.000 entries.
* This cache uses the Google Guava {@link Cache}.
*
* @author Fuzzlemann
* @since 3.5.5
@ -31,7 +31,6 @@ public class GeolocationCacheHandler {
}
private static final Cache<String, String> geolocationCache = CacheBuilder.newBuilder()
.maximumSize(10000)
.build();
/**