Skip to content

Commit

Permalink
handful of the same npe from previous commit, surprised this never sh…
Browse files Browse the repository at this point in the history
…owed up before.
  • Loading branch information
msudol committed Dec 30, 2019
1 parent c0791c4 commit 08a1ea1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: com.pwn9.PwnPlantGrowth.PwnPlantGrowth
name: PwnPlantGrowth
version: 2.5.2
version: 2.5.3
author: tremor77
description: Take control over all plant growth
website: http://pwn9.com
Expand Down
6 changes: 5 additions & 1 deletion src/com/pwn9/PwnPlantGrowth/BlockGrowListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public String runCalcs(BlockGrowEvent e, String thisBlock, String curBiome, Bool
for (int i = 0; i < groupList.size(); i++) {

// check the biomegroup for this named group
if (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome))
if ((plugin.getConfig().getList("BiomeGroup."+groupList.get(i)) != null) && (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome)))
{

toLog += "Matching BiomeGroup." + groupList.get(i) + " ";
Expand All @@ -151,6 +151,10 @@ public String runCalcs(BlockGrowEvent e, String thisBlock, String curBiome, Bool
curDeath = plugin.getConfig().getInt(thisBlock+"."+groupList.get(i)+".DeathDark");
}
}
else
{
toLog += "Missing BiomeGroup." + groupList.get(i) + " ";
}
}
}

Expand Down
15 changes: 11 additions & 4 deletions src/com/pwn9/PwnPlantGrowth/BlockSpreadListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public String runCalcs(BlockSpreadEvent e, String thisBlock, String curBiome, Bo
{

// check the biomegroup for this named group
if (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome))
if ((plugin.getConfig().getList("BiomeGroup."+groupList.get(i)) != null) && (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome)))
{

toLog += "Matching BiomeGroup." + groupList.get(i) + " ";
Expand All @@ -69,6 +69,10 @@ public String runCalcs(BlockSpreadEvent e, String thisBlock, String curBiome, Bo
curDeath = plugin.getConfig().getInt(thisBlock+"."+groupList.get(i)+".Death");
}
}
else
{
toLog += "Missing BiomeGroup." + groupList.get(i) + " ";
}
}
}
else {
Expand Down Expand Up @@ -131,9 +135,8 @@ public String runCalcs(BlockSpreadEvent e, String thisBlock, String curBiome, Bo
for (int i = 0; i < groupList.size(); i++) {

// check the biomegroup for this named group
if (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome))
{

if ((plugin.getConfig().getList("BiomeGroup."+groupList.get(i)) != null) && (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome)))
{
toLog += "Matching BiomeGroup." + groupList.get(i) + " ";

// reference the configs now to see if the config settings are set!
Expand All @@ -147,6 +150,10 @@ public String runCalcs(BlockSpreadEvent e, String thisBlock, String curBiome, Bo
curDeath = plugin.getConfig().getInt(thisBlock+"."+groupList.get(i)+".DeathDark");
}
}
else
{
toLog += "Missing BiomeGroup." + groupList.get(i) + " ";
}
}
}

Expand Down
12 changes: 10 additions & 2 deletions src/com/pwn9/PwnPlantGrowth/StructureGrowListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void structureGrow(StructureGrowEvent e)
for (int i = 0; i < groupList.size(); i++) {

// check the biomegroup for this named group
if (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome))
if ((plugin.getConfig().getList("BiomeGroup."+groupList.get(i)) != null) && (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome)))
{
toLog += "Matching BiomeGroup." + groupList.get(i) + " ";

Expand All @@ -190,6 +190,10 @@ public void structureGrow(StructureGrowEvent e)
curDeath = plugin.getConfig().getInt(curBlock+"."+groupList.get(i)+".Death");
}
}
else
{
toLog += "Missing BiomeGroup." + groupList.get(i) + " ";
}
}
}
else {
Expand Down Expand Up @@ -253,7 +257,7 @@ public void structureGrow(StructureGrowEvent e)
for (int i = 0; i < groupList.size(); i++) {

// check the biomegroup for this named group
if (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome))
if ((plugin.getConfig().getList("BiomeGroup."+groupList.get(i)) != null) && (plugin.getConfig().getList("BiomeGroup."+groupList.get(i)).contains(curBiome)))
{

toLog += "Matching BiomeGroup." + groupList.get(i) + " ";
Expand All @@ -269,6 +273,10 @@ public void structureGrow(StructureGrowEvent e)
curDeath = plugin.getConfig().getInt(curBlock+"."+groupList.get(i)+".DeathDark");
}
}
else
{
toLog += "Missing BiomeGroup." + groupList.get(i) + " ";
}
}
}

Expand Down

0 comments on commit 08a1ea1

Please sign in to comment.