Added getTotalMeteorWeight function

Moved loop to calculate total weight to it's own function, used in NEI tab as well
This commit is contained in:
Bigfluf authored and GitHub committed 2022-04-08 12:01:27 +02:00
1 parent 5c930a479f
commit 00f9fa1add
1 file changed
+16 -10
@@ -36,6 +36,21 @@ public class MeteorParadigm
componentList.add(mpc);
}
}
public int getTotalMeteorWeight()
{
int totalMeteorWeight = 0;
for (MeteorParadigmComponent mpc : componentList)
{
if (mpc == null || !mpc.isValidBlockParadigm())
{
continue;
}
totalMeteorWeight += mpc.getChance();
}
return totalMeteorWeight;
}
public void createMeteorImpact(World world, int x, int y, int z, boolean[] flags)
{
@@ -72,16 +87,7 @@ public class MeteorParadigm
float totalChance = iceChance + soulChance + obsidChance;
int totalMeteorWeight = 0;
for (MeteorParadigmComponent mpc : componentList)
{
if (mpc == null || !mpc.isValidBlockParadigm())
{
continue;
}
totalMeteorWeight += mpc.getChance();
}
int totalMeteorWeight = getTotalMeteorWeight();
for (int i = -newRadius; i <= newRadius; i++)
{