mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e37a932d84 | ||
|
|
595bd797fd | ||
|
|
1593b5482b | ||
|
|
00f9fa1add | ||
|
|
5c930a479f | ||
|
|
d8b0fa1cc9 | ||
|
|
801a8548f2 | ||
|
|
366a22908f | ||
|
|
c72e20a7ef | ||
|
|
79cab43a65 |
No files matched your search
@@ -101,7 +101,6 @@ public class BloodMagicConfiguration
|
||||
AlchemicalWizardry.customPotionDemonCloakID = config.get("Potion ID", "DemonCloak", 115).getInt();
|
||||
AlchemicalWizardry.customPotionAmphibianID = config.get("Potion ID", "Amphibian", 116).getInt();
|
||||
|
||||
MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt();
|
||||
AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true);
|
||||
AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron", "gold", "copper", "tin", "lead", "silver", "osmium"}).getStringList();
|
||||
|
||||
@@ -249,7 +248,7 @@ public class BloodMagicConfiguration
|
||||
AlchemicalWizardry.ritualCostFeatheredEarth = config.get(lpCosts, "Ritual of the Feathered Earth", new int[]{100000, 0}).getIntList();
|
||||
AlchemicalWizardry.ritualCostGaia = config.get(lpCosts, "Gaia's Transformation", new int[]{1000000, 0}).getIntList();
|
||||
AlchemicalWizardry.ritualCostCondor = config.get(lpCosts, "Reverence of the Condor", new int[]{1000000, 0}).getIntList();
|
||||
AlchemicalWizardry.ritualCostFallingTower = config.get(lpCosts, "Mark of the Falling Tower", new int[]{50000, 0}).getIntList();
|
||||
AlchemicalWizardry.ritualCostFallingTower = config.get(lpCosts, "Mark of the Falling Tower", new int[]{100000, 0}).getIntList();
|
||||
AlchemicalWizardry.ritualCostBalladOfAlchemy = config.get(lpCosts, "Ballad of Alchemy", new int[]{20000, 10}).getIntList();
|
||||
AlchemicalWizardry.ritualCostExpulsion = config.get(lpCosts, "Aura of Expulsion", new int[]{1000000, 1000}).getIntList();
|
||||
AlchemicalWizardry.ritualCostSuppression = config.get(lpCosts, "Dome of Suppression", new int[]{10000, 2}).getIntList();
|
||||
|
||||
@@ -36,6 +36,9 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
this.input.add(new PositionedStack(meteor.focusStack, 74, 4));
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
float totalMeteorWeight = meteor.getTotalMeteorWeight();
|
||||
|
||||
for (MeteorParadigmComponent component : meteor.componentList) {
|
||||
ItemStack stack = component.getValidBlockParadigm();
|
||||
List<String> tooltips = new ArrayList<>();
|
||||
@@ -43,7 +46,7 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
stack = new ItemStack(Blocks.fire);
|
||||
tooltips.add(String.format("no entries found for oredict \"%s\"", component.getOreDictName()));
|
||||
}
|
||||
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(component.getChance())));
|
||||
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(component.getChance() / totalMeteorWeight)));
|
||||
this.outputs.add(new TooltipStack(stack, 3 + 18 * col, 37 + 18 * row, tooltips));
|
||||
col++;
|
||||
if (col > 8) {
|
||||
@@ -171,9 +174,9 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private String getFormattedChance(int chance) {
|
||||
float percentage = (float) chance / 10;
|
||||
boolean isInteger = Float.compare(percentage, (float) (chance / 10)) == 0;
|
||||
private String getFormattedChance(float chance) {
|
||||
float percentage = chance * 100.0f;
|
||||
boolean isInteger = percentage - (int) percentage <= 0.01;
|
||||
if (isInteger) return String.format("%,d", (int) percentage);
|
||||
else return String.format("%,.1f", percentage);
|
||||
}
|
||||
|
||||
+19
-5
@@ -16,7 +16,6 @@ public class MeteorParadigm
|
||||
public ItemStack focusStack;
|
||||
public int radius;
|
||||
public int cost;
|
||||
public static int maxChance = 1000;
|
||||
|
||||
public static Random rand = new Random();
|
||||
|
||||
@@ -37,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)
|
||||
{
|
||||
@@ -56,16 +70,13 @@ public class MeteorParadigm
|
||||
}
|
||||
|
||||
int newRadius = radius;
|
||||
int chance = maxChance;
|
||||
|
||||
if (hasOrbisTerrae)
|
||||
{
|
||||
newRadius += 2;
|
||||
chance += 200;
|
||||
} else if (hasTerrae)
|
||||
{
|
||||
newRadius += 1;
|
||||
chance += 100;
|
||||
}
|
||||
|
||||
world.createExplosion(null, x, y, z, newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks);
|
||||
@@ -75,6 +86,8 @@ public class MeteorParadigm
|
||||
float obsidChance = hasTennebrae ? 1 : 0;
|
||||
|
||||
float totalChance = iceChance + soulChance + obsidChance;
|
||||
|
||||
int totalMeteorWeight = getTotalMeteorWeight();
|
||||
|
||||
for (int i = -newRadius; i <= newRadius; i++)
|
||||
{
|
||||
@@ -92,7 +105,8 @@ public class MeteorParadigm
|
||||
continue;
|
||||
}
|
||||
|
||||
int randNum = world.rand.nextInt(chance);
|
||||
int randNum = world.rand.nextInt(totalMeteorWeight);
|
||||
|
||||
boolean hasPlacedBlock = false;
|
||||
|
||||
for (MeteorParadigmComponent mpc : componentList)
|
||||
|
||||
Reference in new issue
Block a user