Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Dries007

      ATTENTION Forum Database Breach   03/04/2019

      There has been a breach of our database. Please make sure you change your password (use a password manager, like Lastpass).
      If you used this password anywhere else, change that too! The passwords themselves are stored hashed, but may old accounts still had old, insecure (by today's standards) hashes from back when they where created. This means they can be "cracked" more easily. Other leaked information includes: email, IP, account name.
      I'm trying my best to find out more and keep everyone up to date. Discord (http://invite.gg/TerraFirmaCraft) is the best option for up to date news and questions. I'm sorry for this, but the damage has been done. All I can do is try to make sure it doesn't happen again.
    • Claycorp

      This forum is now READ ONLY!   01/20/2020

      As of this post and forever into the future this forum has been put into READ ONLY MODE. There will be no new posts! A replacement is coming SoonTM . If you wish to stay up-to-date on whats going on or post your content. Please use the Discord or Sub-Reddit until the new forums are running.

      Any questions or comments can be directed to Claycorp on either platform.
Sign in to follow this  
Followers 0
ECC

Durability/Consumption - Method for coding

1 post in this topic

This is not a typical idea. This idea deals purely with a method to implement a unique form of consumption/durability while maintaining the ability to 'stack'Let us begin by assuming we have a cooked chicken item. As you might be aware, chickens in game are quite sizable. The idea that you are eating an entire chicken as a result seems absurd. But how do you break this down without filling an inventory with cooked chicken items? Using vanilla methods, you can't. Not directly. This brought me to thinking on how an item can be consumed while being capable of stacking.There are three primary things that go into an item. First, stacksize. Your stacksize tells you how many items are there. For this method to work, stacksize is ignored. Items do not stack normally. It is my belief that there is no easy way around this, so items effected by this method can not and will not stack.The second item to keep in mind is DamageValue. This is the little green bar that tells you when a tool is fucked and breaks apart. It is controlled by the metavalue. For example, 363:1. the '1' is the metavalue. This is important for this method to work. There is a single major change to how it functions when using this method, when reaching '0', it returns to the items maximal value. For an item that can reach 100, it returns to 100. However, this is dependent on the third value.The third value is NBT data. These are hidden(non-visible within normal gameplay) values that make up many unique functions of an item. Without them many things would not work. For this, the value will be visible. This value Replaces stacksize in terms of functionality. Assuming chicken stacks to 64, this values max becomes 64 and items can not reach a higher value then this. A single item, say from a newly cooked chicken would be '1'. When crafted with another item, that data is changed to the sum. However, when the items DamageValue reaches zero, the nbt data reduces by 1. if reaching zero, the item is destroyed.so, thats it in a nutshell. to clear things up I'll fill in the info that didn't quite fit up there.- 'Stacking' items is done though crafting. There is no easy way around this if bugs are to be avoided.- Vanilla repair is disabled. This prevents the impossible; You should not be able to create something from nothing.- 'unstacking' is done by placing a stacked item in the crafting grid. The output is a single item. Its a pain, but necessary for this to function with minimal bugs.- Consuming or using reduces the durability. In the case of consuming(eating), the durability is reduced over a period of time as long as the rightclick function is held.

 

 

Edit: it does come to mind that forge may now support turning vanilla repair off. While I strongly advise doing so on items that use this, I also advise not removing it on items such as tools until an alternative method is found.

0

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0