Silent's Gems

Silent's Gems

9M Downloads

[1.12.2] Gem Armor won't gain any XP if Galacticraft's Shield Controller is equipped.

SonicX8000 opened this issue ยท 9 comments

commented

I don't know if you still do bugfixs for the 1.12.2 version of Silent Gems but...

Minecraft: 1.12.2
Forge: 14.23.5.2838

Mods: 6
GalacticraftCore-1.12.2-4.0.2.210
Galacticraft-Planets-1.12.2-4.0.2.210
jei_1.12.2-4.15.0.279
MicdoodleCore-1.12.2-4.0.2.210
SilentLib-1.12.2-3.0.13+167
SilentsGems-1.12.2-2.8.21+325


Gem Armor won't gain any XP if you have Galacticraft's Shield Controller equipped. What that item does is that it prevents your armor from losing durability from most... if not all damage sources.

I have the Shield Controller equipped and hugged some cacti and my Armor wasn't gaining any XP. It will gain XP if I unequipped the Shield Controller. Here's an image...

My character is suffering damage while standing on a cactus. You can see the model having a red glow due to taking damaged recently. The Purple Barrier-like thing is the Shield Controller. If you look at my health I've been standing on the cactus for some time and haven't gained any XP at all.

If I have to guess... the durability lost is what allows the armor to gain XP. Would it be possible to change that to the damage taken from the attack instead of the durability lost? Then again... an XP cap of some sorts will have to be put in place if accounting for Scaling Health's damage scaling & such alongside damage reductions from enchantments, armor, modded damage reductions, etc.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

Should I open an issue on GC's side about this? Or is it an issue on SG's side?

commented

Probably something I would need to fix, assuming it's fixable.

commented

It might be as Construct's Armory Armor with it's Leveling works with the Shield Controller equipped meaning that your Tinkers Armor can still gain XP despite no durability lost.

Using some forbidden arts, I went to check if making the Gem Armor 'Unbreakable' would prevent XP gain and it looks like it can still gain XP despite no durability being lose... unless 'Unbreakable' means that can still take 'damage' towards durability but due to the Unbreakable tag it sets the damage to 0 or something. Not exactly sure how the calculation works for that.

I was going to include the Living Enchantment for this but that mod has a different way to gain levels for your Armor via special XP orbs that are dropped from defeated mobs or if you slay mobs directly.

commented

Is this the line for Gem Armor gaining XP in 1.12.2 branch? In 'ItemGemArmor.java'?

@Override
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
    if (ToolHelper.isBroken(stack)) {
        return;
    }

    if (entity instanceof EntityPlayer) {
        ToolSoul soul = SoulManager.getSoul(stack);
        if (soul != null) {
            soul.addXp((int) (ToolSoul.XP_FACTOR_ARMOR_DAMAGED * damage), stack, (EntityPlayer) entity);
        }
    }

Since the Shield Controller stops durability damage, which I assume is that it sets the durability damage to zero... 'damageArmor' perhaps sees it as if you didn't take damage at all, hence why no XP is gained.

EDIT
Alright, so... certain damage sources don't give XP by the looks of it. This test was done WITHOUT the Shield Controller.

Using a Splash Potion of Instant Damage... I hit myself with it and take damage. My Armor didn't lose any durability and it gained 0 XP. So... only damage sources that damages your armor will it then allow it to gain XP with 'damageArmor'.

I wonder if an 'onHurt' event could be a fix? I'm just making a guess here.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

This issue still exists, although not all damage sources will grant XP. If the attack ignores Armor, the armor will not gain any XP.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

This issue still... exists. Damage sources that damages armor durability will only grant XP.