Spoiled Food

Discussion in 'Plugin Requests' started by IAmKnight, Aug 20, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    IAmKnight

    Hmm, I didn't think about the hopper. Perhaps, if you could test if the good was inserted by hopper, you could check when the food was inserted into the hopper? I'm not fairly certain but I wish you luck on figuring it out.
     
  2. Offline

    IAmKnight

    How is it fairing right now?
     
  3. Offline

    Lordloss

    Even without thinking about hoppers or other plugins changing contents of a chest, it feels pretty hard at the moment. As i said im gonna focus on the other stuff right now. If i cant solve the problem fast i release a "beta" version for you that you can test it out while im working on it.
    EDIT:
    Im assuming that u use this thirst plugin, right?
     
    Last edited: Aug 28, 2016
  4. Offline

    IAmKnight

    That is the correct thirst plugin, yes. However, mine is on a spigot page, but from the looks of it, it's the same version.
    Thank you for working so hard on this, by the way :)
     
  5. Offline

    Lordloss

    No problem, its not easy, but fun to make ;) Currently the created salt gets dropped on the ground, because there is no slot it could go into. Is that okay for you or do you want a different approach?
     
  6. Offline

    IAmKnight

    If possible, could it get put into the input slot in the furnace? If not, it could go into an empty slot or salt slot in the inventory, and if not, it will drop on the ground.
     
  7. Offline

    Lordloss

    The problem with the input slot is, that it is allready occupied with, well, the input ;) In this case water bottles. The salt gets created in the moment an water bottle was fully burned to boiled water. I can try to change it that it gets created when a player takes the result out of the furnace, so it can be put in the inventory.
     
  8. Offline

    IAmKnight

    Well, whatever is actually possible is fine. So whatever you think will work best is up to you :)
     
  9. Offline

    I Al Istannen

    @Lordloss
    For the Hoppers:
    InventoryMoveItemEvent. Then just do the same logic you would do when the chest is opened.

    For the plugins:
    I don't know of any way. Probably not possible.
     
  10. Offline

    Lordloss

    @I Al Istannen
    Thanks im gonna try it out.

    @IAmKnight
    Im glad to tell you that i finally have something to show you. It is not in final stage yet, but most of the functions are ready.
    As said freezing isnt finished, and disabled in config by default.

    Most of it is self-explanatory if you read the config file, you can change in it nearly anything.

    There is one command you can use: /sf reload
    This reloads the config, so you can make live changes on it without server restarting.

    Link

    Please give me feedback on what should be changed, or seems to be buggy.
     
  11. Offline

    IAmKnight

    Awesome, thanks man! I'll go ahead and test it once I get home!
     
  12. Offline

    Lordloss

    Does it work? :p
     
  13. Offline

    IAmKnight

    Haha, we'll see, I just finished the config. A couple of questions now that I finished:
    - Is it possible to add special cooked food times for certain food? While items such as meat get more lifetime, items such as potatos do not. I'm not certain if I can just put the baked potato in the special food section in the config.
    - I realised now that people could exploit a trick where they leave grown crops until needed. I'm not sure if crops in the ground get deteriorated, but I fear it may be too hard to implement out of no where.
    - Also, I just realised Cakes and Melons/Pumpkins aren't food items, so not sure if they get deteriorated, either, this all seems like really difficult stuff so it's fine if it's too hard.
    However from the looks of it all you've done a fantastic job, so thank you!

    A bug found: Some of my players get a message that looks like this:
    NCP: [Player] failed FastConsume: consumes [food] too fast. VL [No.]

    It displays in public chat.

    This is a NoCheatPlus error, as I believe the SpoiledFood plugin is causing NCP to act up. Not sure what to do.
     
    Last edited: Sep 1, 2016
  14. Offline

    Lordloss

    For cooking food, i remember to put an option in the config for durability regain on cooking, but im not sure, i cant look at it right now as im at work. I can make it configurable per item.
    For cake/melon in inventory: They are not recognised as edible, but i could do a workaround for them. I would have to mess with the crafting to melon slices, but this should not be the problem
    I could make that spoiled cakes cannot be placed, if you want. Out of multiple reasons i think making placed blocks spoilable is too hard. Previously placed blocks could not be recognized,
    also all naturally generated blocks. Maybe i would need an extra config or database to store all placed food blocks, and they should only start to spoil if theyre fully grown, so i need to check them consistently, only if they are in loaded chunks.
    Maybe if i have too much time :D

    I dont know why NCP throws this messages. Normally only OPs get them. I dont know if its possible to disable the messages for food only. I can mess around a bit with it.
     
  15. Offline

    9UjtOAtcBA

    @Lordloss

    I know this isn't really a thread of mine, but it would be an excellent feature if the end user could configure the foods for which spoiling occurs. If possible, also customizable spoiling settings for each item would be a great addition.
     
  16. Offline

    Lordloss

    @9UjtOAtcBA
    If you looked a bit deeper into it, you would have recognized that you can configure a standard spoiling time which is for every food item.
    But also a special spoiling time which you can define for every item seperately which will override the default.
    Also you can make every food item you want not spoilable. Look in the config, you can modify many things.
     
  17. Offline

    IAmKnight

    @9UjtOAtcBA What he said, it's pretty configurable.
     
  18. Offline

    9UjtOAtcBA

    @Lordloss I have in fact kept quite a keen eye on this topic.

    Pardon me, for my articulation may have been somewhat poor.

    My intention was to suggest the ability to make various other items spoilable. The system in place is grand and seems functional, but I see no reason to limit it to the pre-set food items. From what I can see and understand, this plugin eyeballs chest and player inventories, adding a custom lore to spoilable items, which determines that item's state of spoil and other attributes related to spoiling, such as freezing.

    My suggestion, in greater detail, was to be able to define more food items. There are a myriad of plugins out there that add more food items, such as Slimefun and ThreeSquareMeals. If this plugin can track and modify vanilla items, then surely it can track and modify other, non-vanilla items defined in its configuration.

    My sincerest of apologies for my potential idiocy regarding this subject.
     
  19. Offline

    IAmKnight

    Do you mean food items that are created from other plugins, that aren't the normal minecraft food items?
     
  20. Offline

    9UjtOAtcBA

    @IAmKnight I refer to the ability of adding any combination of item ID, Damage Value, and Itemname to the list of items this plugin keeps an eye on. For example, if the format were

    'ItemID;ItemDamage;Name'

    A cookie named as pancake would be added as follows:

    '357;0;&fPancakes'

    After defining a new item in the config, unique freeze/spoil/lifetime could be added to them to override the default.
     
  21. Offline

    Lordloss

    @9UjtOAtcBA
    Yes of course this could be added if wished. At the moment using a custom item like this would result in the custom name gets overriden. But its possible to modify it so that it works. I just focused on the requested vanilla food items, which means any Material on which isEdible returns true.
     
  22. Offline

    IAmKnight

  23. Offline

    JanTuck

    NbtData?
    Edit: hadnt read any other posts yet sry
    Sent from Tapatalk
     
  24. Offline

    IAmKnight

    @Lordloss just wanted to ask if it's possible for multiverse support? Also if you have stopped working on it can you send the source code so I can try finishing it? Thank you :)
     
  25. Offline

    Lordloss

    It works in every world. What you mean with multiverse support?
     
  26. Offline

    9UjtOAtcBA

    @Lordloss
    Probably the ability to either disable food items or the functions of the plugin per-world, or have a different configuration per-world, or have a world blacklist.

    But that's just my guess.
     
  27. Offline

    IAmKnight

    @Lordloss As @9UjtOAtcBA said. I have another world where I'd like a different type of config. I can see how this would work by having the file structure as SpoiledFood > Worlds > (World) > Config.yml
    Thanks :)
     
Thread Status:
Not open for further replies.

Share This Page