Comments (4)
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.
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.
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.
-
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.
-
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.
-
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.
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)
- Add a config option to consume spell books when they are bound to a wand (but not for scrolls)
- [Bug] Exception caught during firing event HOT 1
- [1.12.2] Conflict with Mekanism Community Edition. Mekanism Custom Armor Models don't render if "Spellcasting Animations" is enabled.
- mod id filter type for the spells creative tab HOT 1
- Add a config option to allow spell cooldowns to continue when you are not holding it HOT 1
- [Bug] I'm crashing everytime I go in my solo world help HOT 2
- [Bug] Crashing everytime I get into my solo world. HOT 2
- [Bug] Crash and world lockdown, possible incompatibility
- [Bug][1.12.2] magic_crystal metadata CraftTweaker/JEI compat
- [Bug] Crash when launching the game. 1.12.2. HOT 8
- [Bug] java.lang.IllegalArgumentException when trying to render botania manasteel armor in cosmetic slots (sometimes)
- Lootr chests replaces bookshelfs in generated structures HOT 1
- [Bug] <Woes with Shrines and Obelisks>
- [Bug] When I play with the Vampirism mod, the mana bar disappears
- [Bug] "Ancient Compass" artifact on server
- Spell Cast Command does not implement finishCasting method
- [Reopened] Lectern and Bookshelf "location" outline rendering bug (UPDATED) HOT 2
- [Bug] Shift clicking in the wizard trade menu is bugged HOT 2
- [Bug] Neutral Wizards do not become hostile when blocks are broken in their structure out of their line of sight
- [Bug] Latest release causing game crash when opening sound settings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wizardry.