Construct's Armory

Construct's Armory

30M Downloads

Is Petravidity Trait Working?

PlasticPhoenix opened this issue ยท 9 comments

commented

Versions (Be specific, do not write "latest"):

  • Construct's Armory: 1.12.2-0.0.19-b
  • Tinkers' Construct: 1.12.2-2.10.0.81
  • Mantle: 1.3.2.24
  • Forge: 14.23.4.2705

Observed Behavior:

From what I believe from in game book and reading the java, picking up a stack of Stone objects should cause armor with Petravidity trait to consume the stone and heal themselves.

Expected Behavior:

Nothing ever happens, the trait does not seem to work.

Steps to Reproduce:

  1. Have damaged armor with Petravidity trait
  2. Pickup stack of stone
  3. No healing occurs

I have attempted this while wearing armor, not wearing, in bar, active in bar. Tried mining fresh stone, picking up cobblestone, smooth stone. I looked at the java for the trait, and I was just wondering if something is going wonky with that second comparison done (the one that checks for type of stone). I see where you used getitem() from the passed parameter, which looks normal. Then, you use getitem() again when you check. I've only done some modding myself, but it just looked odd to me. There are no complaints in the logs about it.

commented

The double getItem() is because EntityItem#getItem yields an ItemStack while an ItemStack#getItem yields an Item, so this needs to be done twice to go from EntityItem -> ItemStack -> Item.

I'll do some testing and get back to you about this.

commented

I cannot reproduce this. Picking up smooth stone heals my armor as expected. Note that it has to be smooth stone, although this was unintentional and I'm going to update this to include cobblestone in the future. Can you reproduce this with only Construct's Armory and Tinkers' Construct? If not, this is most likely a mod compatibility conflict somehow.

commented

Ok, this is strange, it's working now. My gear, which is all down to about 2/3 damage started healing as soon as I picked up smooth stone. Well, that's good to know. Cooking up some stacks now and healing up my gear. I was worried I have to whip up some Osmiridium or Many to repair them. Love this mod, by the way, and thanks for the quick reply. Looks like we can close this issue. Also, are you sure you want to include Cobblestone? I think it would be too easy for repairs. At least requiring smooth stone means you have to cook it, or use silk touch (assuming that would work), so you at least have some investment in time and effort.

commented

I'm glad it ended up working somehow.

Petravidity is basically meant as an armor substitute for Tinkers' Petramor for tools, which includes cobblestone. I want them to act as similarly as possible. However, there are some factors to take into consideration such as the fact that dropping a stack of 64 and picking it up is much easier than mining that same stack of 64. I'll have to think on it to find the best solution.

commented

Honestly, just checking the inventory for stone should be viable, as there are mods that change the way drops work. For example, Auto Pickup makes it so drops go straight into the player's inventory, so the pickup itself doesn't happen.

commented

Now using version: 0.0.21-rc1

Since the change to the Petravidity trait, I've not noticed any effect from the Trait. According to your change notes and the code, it should increase the modifier by 20% and have a 10% change to heal 3 damage when you have any blocks of Material.Rock around you. I have been unable to see any change in armor stats or any healing occurring since the change. I have spent several hours in caves and around my base (which has lots of Polished Andesite as paver paths). Can you verify that this is functioning, or do I need to recreate the armor? I have not attempted a new piece of armor yet, since that shouldn't matter.

commented

Let me do some testing. And no, you shouldn't have to recreate the armor.

commented

I can verify that this is functioning. For clarification, there won't be any visual indications that Petravidity is increasing armor stats. These are internal calculations done when being hurt. Also, just to make sure the ambiguous wording isn't a misunderstanding, it doesn't heal the user, it heals the armor durability. In addition, this healing only has a chance to occur when being hurt AND being around rocky blocks.

commented

Ah, the event is only triggered upon damage. Ok, that explains it. I had gotten used to the last design and was able to keep my armor up. Now, it's all about 25% durability after awhile, so Petravidity probably slows the degradation, but can't reliably heal it all the way up like before. Ok, thanks for the clarification.