From 00f9fa1add03ff8890c4f94abd41b9a4d2fdf48f Mon Sep 17 00:00:00 2001 From: Bigfluf <34474265+Bigfluf@users.noreply.github.com> Date: Fri, 8 Apr 2022 12:01:27 +0200 Subject: [PATCH] Added getTotalMeteorWeight function Moved loop to calculate total weight to it's own function, used in NEI tab as well --- .../summoning/meteor/MeteorParadigm.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java index f649b4bf..3e51f5e4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java @@ -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++) {