yeelp / Scaling-Feast

A simple, balanced way to increase your maximum hunger in Minecraft over the course of a world.
MIT License
0 stars 1 forks source link

Unlocalized string: attribute.name.scalingfeast.maxHunger #79

Closed James103 closed 4 years ago

James103 commented 4 years ago

Mod Version: scalingfeast-1.5.0 Minecraft Version: 1.12.2 Loaded Mods: (Reproducible with just Scaling Feast)

Describe the bug attribute.name.scalingfeast.maxHunger is unlocalized. image

Steps to Reproduce

  1. /give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"a",Amount:10,Operation:0,UUIDLeast:131107,UUIDMost:716360,Slot:"mainhand"}]}

Expected behavior attribute.name.scalingfeast.maxHunger is localized as "Max Hunger". image

Additional context The potion effects of Hunger Plus and Hunger Minus correctly say "Max Hunger". image

Also, modifiers affecting this attribute that are attached to various items seems to have no effect. Is there something wrong with the setup in the following commands (executed in that order), or is it a bug within Scaling Feast?

  1. /sf setMax @p 500
  2. /effect @p saturation 2 255
  3. /give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"a",Amount:10,Operation:2,UUIDLeast:131107,UUIDMost:71636,Slot:"mainhand"}]}
  4. /give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"b",Amount:10,Operation:1,UUIDLeast:131107,UUIDMost:716360,Slot:"mainhand"}]}
  5. /give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"b",Amount:10,Operation:0,UUIDLeast:131107,UUIDMost:71630,Slot:"mainhand"}]}
yeelp commented 4 years ago

Actually the attribute has the name scalingfeast.maxHungerMod, so if you switch to that, everything will work.

In hindsight, I'm not sure why I named it that. In the moment, it made sense but looking back, it seems unintuitive.

I mainly did this because the max hunger isn't being stored as a attribute but instead as a capability, with a separate capability for modifying it (which I haven't changed for backwards compatibility, I see now that I should've made it an attribute and any version 2.0 will see that change made). Doing a percentage modifier like "+300% max hunger" won't actually see your max hunger go up by 300% but instead you'll see the modifier value changed by 300% so any bonuses to your max hunger via SOL:Carrot Edition integration etc. will be increased by 300%, if that makes sense.

Feel free to continue the discussion here if you like to propose a different way of doing this that's ideally backwards compatible but for now, this issue is going to be closed as it's not applicable.

yeelp commented 4 years ago

I actually came up with an idea that should be backwards compatible and should allow a more direct alteration of max hunger

To future me: Store an NBTTagByte in each NBTTagCompound in IFoodCapModifier that represents the operation to perform. Follow the same steps taken by Minecraft for attribute values.