mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-07 12:11:22 +01:00
Small bugfixes:
Crafting recipes being visually constrained by additive RNG even when multiplicative is selected. A pair of variables from the config not being read but until the first `/mmoitems reload`.
This commit is contained in:
parent
46b17a7f5a
commit
dc980ffcd5
@ -13,6 +13,8 @@ import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
|
||||
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerData;
|
||||
import net.Indyuce.mmoitems.api.crafting.MMOItemUIFilter;
|
||||
import net.Indyuce.mmoitems.api.util.MMOItemReforger;
|
||||
import net.Indyuce.mmoitems.api.util.NumericStatFormula;
|
||||
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
|
||||
import net.Indyuce.mmoitems.command.MMOItemsCommandTreeRoot;
|
||||
import net.Indyuce.mmoitems.comp.*;
|
||||
@ -187,6 +189,10 @@ public class MMOItems extends LuminePlugin {
|
||||
layoutManager.reload();
|
||||
stationRecipeManager.reload();
|
||||
|
||||
// This ones are not implementing Reloadable
|
||||
NumericStatFormula.reload();
|
||||
MMOItemReforger.reload();
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(entityManager, this);
|
||||
Bukkit.getPluginManager().registerEvents(dropTableManager, this);
|
||||
Bukkit.getPluginManager().registerEvents(new ItemUse(), this);
|
||||
|
@ -156,7 +156,9 @@ public class NumericStatFormula implements RandomStatData {
|
||||
*/
|
||||
public double calculate(double levelScalingFactor, double random) {
|
||||
|
||||
if (useRelativeSpread) { return (base + scale * levelScalingFactor) * (1 + Math.min(Math.max(random * spread, -maxSpread), maxSpread)); }
|
||||
if (useRelativeSpread) {
|
||||
//SPRD//if (spread > 0) MMOItems.log("\u00a7c༺\u00a77 Using \u00a7eRelative\u00a77 spread formula: \u00a76μ=" + (base + scale * levelScalingFactor) + "\u00a77, \u00a73σ=" + (spread * (base + scale * levelScalingFactor) + "\u00a7b=" + spread + "×" + (base + scale * levelScalingFactor)) + " \u00a7c@" + random + "\u00a7e = " + (base + scale * levelScalingFactor) * (1 + Math.min(Math.max(random * spread, -maxSpread), maxSpread)));
|
||||
return (base + scale * levelScalingFactor) * (1 + Math.min(Math.max(random * spread, -maxSpread), maxSpread)); }
|
||||
|
||||
/*
|
||||
* The mean, the center of the distribution
|
||||
@ -177,6 +179,7 @@ public class NumericStatFormula implements RandomStatData {
|
||||
if (gaussSpread > (getMaxSpread())) { gaussSpread = getMaxSpread(); }
|
||||
|
||||
// That's it
|
||||
//SPRD//if (spread > 0) MMOItems.log("\u00a7c༺\u00a77 Using \u00a7aAdditive\u00a77 spread formula, \u00a76μ=" + (base + scale * levelScalingFactor) + "\u00a77, \u00a73σ=" + (spread) + " \u00a7c@" + random + "\u00a7e = " + (actualBase + gaussSpread));
|
||||
return actualBase + gaussSpread;
|
||||
}
|
||||
|
||||
|
@ -243,13 +243,6 @@ public class Elements extends ItemStat implements Previewable {
|
||||
double techMinimumDEF = nsfDEF.calculate(0, -2.5);
|
||||
double techMaximumDEF = nsfDEF.calculate(0, 2.5);
|
||||
|
||||
// Cancel if it its NEGATIVE and this doesn't support negative stats.
|
||||
if (techMinimum < (nsf.getBase() - nsf.getMaxSpread())) { techMinimum = nsf.getBase() - nsf.getMaxSpread(); }
|
||||
if (techMaximum > (nsf.getBase() + nsf.getMaxSpread())) { techMaximum = nsf.getBase() + nsf.getMaxSpread(); }
|
||||
|
||||
if (techMinimumDEF < (nsfDEF.getBase() - nsfDEF.getMaxSpread())) { techMinimumDEF = nsfDEF.getBase() - nsfDEF.getMaxSpread(); }
|
||||
if (techMaximumDEF > (nsfDEF.getBase() + nsfDEF.getMaxSpread())) { techMaximumDEF = nsfDEF.getBase() + nsfDEF.getMaxSpread(); }
|
||||
|
||||
// Display if not ZERO
|
||||
if (techMinimum != 0 || techMaximum != 0) {
|
||||
|
||||
|
@ -160,15 +160,13 @@ public class DoubleStat extends ItemStat implements Upgradable, Previewable {
|
||||
Validate.isTrue(templateData instanceof NumericStatFormula, "Template Data is not Numeric Stat Formula");
|
||||
|
||||
// Get Value
|
||||
//SPRD//MMOItems.log("\u00a7c༺\u00a77 Calulating deviations of \u00a7b" + item.getMMOItem().getType().toString() + " " + item.getMMOItem().getId() + "\u00a77's \u00a7e" + getId());
|
||||
double techMinimum = ((NumericStatFormula) templateData).calculate(0, -2.5);
|
||||
double techMaximum = ((NumericStatFormula) templateData).calculate(0, 2.5);
|
||||
|
||||
// Cancel if it its NEGATIVE and this doesn't support negative stats.
|
||||
if (techMaximum < 0 && !handleNegativeStats()) { return; }
|
||||
if (techMinimum < 0 && !handleNegativeStats()) { techMinimum = 0; }
|
||||
if (techMinimum < ((NumericStatFormula) templateData).getBase() - ((NumericStatFormula) templateData).getMaxSpread()) { techMinimum = ((NumericStatFormula) templateData).getBase() - ((NumericStatFormula) templateData).getMaxSpread(); }
|
||||
if (techMaximum > ((NumericStatFormula) templateData).getBase() + ((NumericStatFormula) templateData).getMaxSpread()) { techMaximum = ((NumericStatFormula) templateData).getBase() + ((NumericStatFormula) templateData).getMaxSpread(); }
|
||||
|
||||
// Add NBT Path
|
||||
item.addItemTag(getAppliedNBT(currentData));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user