Charles445 / RLTweaker

Pack specific mod to tweak and fix miscellaneous things
MIT License
2 stars 5 forks source link

[1.12.2] Potion Core Resistance + Vanilla Resistance conflicts. #8

Open SonicX8000 opened 2 years ago

SonicX8000 commented 2 years ago

Minecraft: 1.12.2 Forge: 14.23.5.2860

Mods: 4 jei_1.12.2-4.16.1.302 PotionCore-1.9_for_1.12.2 QualityTools-1.0.7_for_1.12.2 RLTweaker-1.12.2-0.4.8


While doing some tests with scaling health priorities... I discovered a bug with Potion Core's Resistance. Apparently it can go to 100% which blocks all damage taken, in fact even if you had 150% Potion Core Resistance it'll still only block 100% of the damage... however... if you should gain any Vanilla Resistance... this may cause a problem where it can actually make you take damage, rather than reduce it.

This test was done with only the listed mods above. ToroHUD was used to see the damage particles and Quality Tools was used in order to get the Potion Core Resistance attributes. Note that toroHUD rounds up the damage taken so 2.5 may show as 3.

=====

Zombie Pigman hits me for 12 Damage with no resistance of any kind on World Difficulty Hard.

Resistance I (+20%) = 10 Damage Taken. Resistance II (+40%) = 7 Damage Taken. Resistance III (+60%) = 5 Damage Taken. Resistance IV (+80%) = 2 Damage Taken.

+50% Potion Core Resist = 6 Damage Taken. +100% Potion Core Resist = 0 Damage Taken.

I am now gonna add in scaling health but without any damage scaling, as it has a debug option to show your exact health value. This is what I get with both Resistances. Note that this can happen without scaling health being used.

+50% Potion Core Resistance + Resistance I (+20%) = 4 Damage Taken. (16.16 / 20.0 Health) +50% Potion Core Resistance + Resistance II (+40%) = 3 Damage Taken. (17.119999 / 20 Health) +50% Potion Core Resistance + Resistance III (+60%) = 3 Damage Taken. (17.119999 / 20 Health) +50% Potion Core Resistance + Resistance IV (+80%) = 2 Damage Taken. (18.08 / 20.0 Health)

+100% Potion Core Resistance + Resistance I (+20%) = 2 Damage Taken. (18.08 / 20.0 Health) +100% Potion Core Resistance + Resistance II (+40%) = 3 Damage Taken. (17.119999 / 20 Health) +100% Potion Core Resistance + Resistance III (+60%) = 3 Damage Taken. (17.119999 / 20 Health) +100% Potion Core Resistance + Resistance IV (+80%) = 2 Damage Taken. (18.08 / 20.0 Health)

Either +50% or +100% Potion Core Resistance + Resistance V (+100%) = 0 Damage Taken. (20.0 / 20.0)

=====

I am not sure if this is even known, now thinking about it.

SonicX8000 commented 2 years ago

Thanks to the Potiontweaker mod which allowed me to change the protection value for the Resistance effect. Potioncore is actually doing some weird things with Vanilla Resistance once it goes above level 5. Posting it here just in case it might be related.

With the use of Scaling Health so I can upscale the damage taken... I did a test with Resistance at 0.2 which is 20% per level, a test with Resistance at 0.1 which is 10% per level, a test with Resistance at 0.2 but with Potioncore added, finally a test with Resistance at 0.1 but with Potioncore added.

Here are my results.

[00:59:15] [Server thread/INFO] [Scaling Health]: cactus on NPC_NAME: 1.0 (1.0 -> 1001.0) | 'scale=5.0, affected=200.0, change=1000.0' | blight=false

(0)R0= 1001 1001 1001 1001 |  0%
(-)R1= ---- 0901 ---- 0901 | 10%
(1)R2= 0801 0801 0801 0801 | 20%
(-)R3= ---- 0701 ---- 0701 | 30%
(2)R4= 0601 0601 0601 0601 | 40%
(-)R5= ---- 0501 ---- 0501 | 50%
(3)R6= 0400 0400 0400 0480 | 60%
(-)R7= ---- 0300 ---- 0420 | 70%
(4)R8= 0200 0200 0200 0320 | 80%
(-)R9= ---- 0100 ---- 0180 | 90%
(T)RT= 0000 0000 0000 0000 |100%
===========================
Resist  0.2 0.1 0.2PC 0.1PC

I dunno why it does this when you go above 60% if the value is set to 0.1. I also tried the test with LOWEST, HIGH and HIGHEST priority for the scaler in case it effected the tests and they were the same results.

EDIT I got a reply from the Potiontweaker dev about the issue.

I took a look at PotionCores sourcecode and found that it changes the resistance calculation with hardcodes increments of 0.2D (20%). This is the reason why the damage taken at Resistance level 6 calculates the wrong values. PotionTweakers calculation is applied first: 1000 0.4 = 400, then PotionCore's calculation step is applied: 400 1.2 = 480. I cannot change the way potioncore handles it's calculations, so this is a dead end.

Wonder if the dev of Potioncore will have to do any changes on their side, since it's expecting Vanilla Resist to always be 0.2 (20%) per level.