Woot

Woot

24M Downloads

Health to tier map incorrect

Ipsis opened this issue ยท 2 comments

commented

The below should do the following:

  • health T3_UNITS_MAX + 1 (61) -> T4_UNITS_MAX (65535) = tier 4 mob
  • health T2_UNITS_MAX + 1 (41) -> T3_UNITS_MAX (60) = tier 3 mob
  • health T1_UNITS_MAX + 1 (21) -> T2_UNITS_MAX (40) = tier 2 mob
  • health 0 -> T1_UNITS_MAX (20) = tier 1 mob

However it is actually doing:

  • health >= T4_UNITS_MAX (65535) = tier 4
  • health >= T3_UNITS_MAX (60) = tier 3
  • health >= T2_UNITS_MAX (40) = tier 2
  • otherwise tier 1 (T1_UNITS_MAX (20))

Which is mapping a mob to a lower tier than it should be.
eg. health 80 Elder Guardian would be tier 3, it SHOULD be tier 4

if (integerMobMap.containsKey(key)) {
            // User will select 1-4, but getTier expects enum oridinals
            int tierKey = integerMobMap.get(key) - 1;
            tier = EnumMobFactoryTier.getTier(tierKey);
        } else {
            int cost = getSpawnCost(world, wootMobName);
            if (cost >= getInteger(wootMobName, EnumConfigKey.T4_UNITS_MAX))
                tier = EnumMobFactoryTier.TIER_FOUR;
            else if (cost >= getInteger(wootMobName, EnumConfigKey.T3_UNITS_MAX))
                tier = EnumMobFactoryTier.TIER_THREE;
            else if (cost >= getInteger(wootMobName, EnumConfigKey.T2_UNITS_MAX))
                tier = EnumMobFactoryTier.TIER_TWO;
            else
                tier = EnumMobFactoryTier.TIER_ONE;
        }
commented

I'm going to fix this ..... but for now I'm not going to push the code.

Since nobody has really noticed the issue and by fixing it is going to shift every undefined mob up one tier, this is going to cause a lot of issue for users. People are going to have working Woot factories that suddenly stop working, because the mob has shifted up by one unexpectedly.

This only impacts mobs that are NOT in factory_config with a specified tier.

So for now, this bug will remain open but unfixed.
One possible option is to add a config option to enable this fix, which defaults to off, so a modpack could intentionally make this change, rather than it impacting their player experience without their knowledge.

commented

Fixed in the 1.15/1.16 series