Cuberite Forum
Fixies v2 (merged into Core r635+) - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html)
+---- Forum: Archived Plugins (https://forum.cuberite.org/forum-18.html)
+---- Thread: Fixies v2 (merged into Core r635+) (/thread-492.html)

Pages: 1 2


RE: Fixies - xoft - 06-16-2012

I know that I don't document things too well, true. Sorry for that confusion. Any chance you can write up some documentation on those 3 crafting hooks into the wiki, too?


RE: Fixies v2 (fixed) - Taugeshtu - 06-16-2012

Bug fix is done Smile
I'll try to write all basic documentation (hooks and classes description)
Although I might need some help in things I don't quite understand (for example JSON)


RE: Fixies v2 (fixed) - xoft - 06-16-2012

Ignore json, it is used only for PAK files saving and for some reason it has been exported to Lua, I think by accidentTongue


RE: Fixies v2 (fixed) - xoft - 06-20-2012

We discussed this with FakeTruth, and we'd like to ask you for your permission to merge this plugin into the Core. It is, after all, a "basic functionality", so it would make sense to have it "out of the box". Also, it would mean SVN versioning for the code Smile Would you be willing to make this contribution?


RE: Fixies v2 (fixed) - Taugeshtu - 06-20-2012

Sure thing Smile Merge!
But leave possibility to set BONUS factor, please)


RE: Fixies v2 (fixed) - xoft - 06-20-2012

As of Rev 635 the Fixies plugin source is integrated into Core. No need to download this separate plugin.


RE: Fixies v2 (merged into Core r635+) - Taugeshtu - 06-20-2012

I appologize, but seems like you forgot "if fixing items are damaged" check Smile
Here's "fixed" oncraftingnorecipe.lua, and below there's added bit of code:
Code:
if (
    (Items[1].m_ItemHealth == 0)    or
    (Items[2].m_ItemHealth == 0)
)
then
    -- Only damaged items may be fixed
    return false
end

Cheers Wink


RE: Fixies v2 (merged into Core r635+) - cedeel - 06-20-2012

(06-20-2012, 09:41 AM)Taugeshtu Wrote: I appologize, but seems like you forgot "if fixing items are damaged" check Smile
Here's "fixed" oncraftingnorecipe.lua, and below there's added bit of code:
Code:
if (
    (Items[1].m_ItemHealth == 0)    or
    (Items[2].m_ItemHealth == 0)
)
then
    -- Only damaged items may be fixed
    return false
end

Cheers Wink

Your code is wrong. Tools and weapons do not get their health set to 0 when damaged. You need some way of comparing to their values when new.


RE: Fixies v2 (merged into Core r635+) - xoft - 06-20-2012

Oh dear, it seems I didn't use the latest version of FixiesTongue Sorry for that.

Cedeel, are you sure? I think a newly crafted tool gets health of 0 and each time it is used the value increments, until the tool breaks. So what we're calling "health" is actually "damage". So the code should be okay - if at least one of the items is undamaged, don't let the user repair it.


RE: Fixies v2 (merged into Core r635+) - cedeel - 06-21-2012

(06-20-2012, 05:49 PM)xoft Wrote: Oh dear, it seems I didn't use the latest version of FixiesTongue Sorry for that.

Cedeel, are you sure? I think a newly crafted tool gets health of 0 and each time it is used the value increments, until the tool breaks. So what we're calling "health" is actually "damage". So the code should be okay - if at least one of the items is undamaged, don't let the user repair it.

Awesome, wasn't around the code to check, it just seemed wrong to meTongue