mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-24 11:37:06 +01:00
Upgraded gradle file and fixed a nullpointer
This commit is contained in:
parent
c8efcbb801
commit
f5deb96d2e
@ -16,7 +16,7 @@ tasks.withType(JavaCompile) {
|
||||
}
|
||||
|
||||
String getPluginData(String tag) {
|
||||
File file = new File("src/main/resources/plugin.yml")
|
||||
File file = file("src/main/resources/plugin.yml")
|
||||
String version = "notfound"
|
||||
file.readLines("UTF-8").each {String line ->
|
||||
line = line.trim()
|
||||
|
@ -74,11 +74,13 @@ public class Portal {
|
||||
|
||||
ConfigurationSection portalConfigSection = portalData.getConfig().getConfigurationSection(portal.toString());
|
||||
|
||||
String[] blockTypesString = portalConfigSection.getString("triggerblock").split(",");
|
||||
String blockTypesRaw = portalConfigSection.getString("triggerblock");
|
||||
|
||||
String[] blockTypesString = blockTypesRaw != null ? blockTypesRaw.split(",") : null;
|
||||
|
||||
HashSet<Material> blockTypes = getMaterialSet(blockTypesString);
|
||||
|
||||
if(blockTypes.size() == 0) {
|
||||
if(blockTypes.isEmpty()) {
|
||||
blockTypes.add(Material.NETHER_PORTAL);
|
||||
}
|
||||
|
||||
@ -132,12 +134,15 @@ public class Portal {
|
||||
public static HashSet<Material> getMaterialSet(String[] blockTypesString) {
|
||||
HashSet<Material> blockTypes = new HashSet<>();
|
||||
|
||||
if (blockTypesString != null) {
|
||||
for(String blockType : blockTypesString) {
|
||||
Material material = Material.getMaterial(blockType);
|
||||
if(material != null) {
|
||||
blockTypes.add(material);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return blockTypes;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
|
||||
name: AdvancedPortals
|
||||
version: 0.2.0
|
||||
version: 0.2.1
|
||||
author: sekwah41
|
||||
description: An advanced portals plugin for bukkit.
|
||||
api-version: 1.13
|
||||
|
Loading…
Reference in New Issue
Block a user