Giter Site home page Giter Site logo

Comments (4)

Tora-B avatar Tora-B commented on July 17, 2024

Ooooook, I see now that this has been... partially fixed in 8360e52, but that just hasn't been pushed to a release. No wonder I've been pulling my hair out, trying to figure out how the code in the repo could possibly be producing the results I'm seeing. I think there are a few issues with the commit, which I may attempt to tackle later.

from wizardry.

Electroblob77 avatar Electroblob77 commented on July 17, 2024

Ok thanks for all this information. The armour code is old and clearly hasn't survived the port from 1.7.10 very well! I want to try and fix some more bugs before releasing a patch with those changes, just haven't had the time until now. I'll be testing the changes from that PR anyway to check everything works as it's supposed to.

from wizardry.

Tora-B avatar Tora-B commented on July 17, 2024

Like I said, many mods have had similar issues, due to the introduction of the armor and toughness attributes in 1.9, and some changes to ISpecialArmor that have gone unnoticed. Actually, the current state of the repo makes the problem arguably worse -- instead of just incorrectly displaying more armor than it provides, the current changes actually double up the protection, because both the attributes and ISpecialArmor#getProperties() are providing full protection. Apparently in the past, using ISpecialArmor meant the normal Minecraft armor mechanics and stats were ignored for that item, but some changes on Forge's end in the past year have made that no longer the case, and both are applied.

There are basically three ways to handle this, depending on what you actually want your armor to do.

  1. Cut the attributes entirely, and depend on ISpecialArmor. This does mean you'll no longer get armor stats on the item tooltip, but you can add them yourself if you desire. You'll also need to use getArmorDisplay() to make the armor show up on the HUD. This is basically what you had before the recent commits -- all you needed to do was strip the armor attributes off. This was Vazkii's solution for Botania. Do consider that this means the item takes considerably more durability damage than the vanilla system unless you handle it. In vanilla, items take 1 damage for every 4 incoming damage, but DamageArmor passes the full value to you, with the intention that you handle whatever scaling is appropriate, since it's primarily intended for items that do not use the normal durability mechanics. While you've rebranded durability as Mana, you've only given wizard armour durability equivalent to iron, so it will be used up four times as fast.

  2. Drop ISpecialArmor entirely. The reasons for its existence are mostly no longer relevant, unless you want to respond differently to different kinds of damage. Improvements to both vanilla and Forge have largely rendered it irrelevant. You're not really using it, since you're not doing anything special in getProperties() or DamageArmor(), just mimicking the old vanilla damage formula. To handle only providing protection while the item has mana, just strip out the attributes if it's empty, and to handle Legendary status, tack on a separate armor modifier if the tag is there.

  3. Handle base armor with attributes, and handle special damage reduction with ISpecialArmor, if you want to do things like resistance to particular spells or elements. Mostly the same as the second option, you just need to make sure you're not duplicating the base protection in getProperties().

from wizardry.

Electroblob77 avatar Electroblob77 commented on July 17, 2024

Thanks for your explanation. I believe I used ISpecialAmor primarily to allow rendering of the custom model. If that is still necessary, I'll go for the third solution, but if not it might make sense to ditch ISpecialArmor entirely.

Nope, that's actually in Item, not ISpecialArmor. Guess I'll be dropping ISpecialArmor then - I might do resistance to specific elements or whatever in future, but I'd probably sooner do it using events anyway.

from wizardry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.