[MISC] CustomCrafting V0.6- add custom crafting and furnace recipes [1060]

Discussion in 'Inactive/Unsupported Plugins' started by nickguletskii, May 2, 2011.

  1. Offline

    nickguletskii

    CUSTOMCRAFTING HAS A NEW HOME!
    Mod Edit (Butkicker12): Removed link.

    THIS PLUGIN WAS MADE BY ME BECAUSE I DIDN'T KNOW ABOUT COOKBOOK AT THE TIME! PLEASE CHECK OUT COOKBOOK BY FULLWALL!
    CREDIT GOES TO @Celtic Ministrel FOR MAKING A COOL RECIPE API!
    CustomCrafting - a plugin that can be used for creating custom crafting recipes.
    Version: 0.6

    Features:
    • Adds custom crafting recipes.
    • Adds custom furnace recipes.
    Download:

    Semi-Direct
    Source
    Recipe creator by @DerEchteNexus
    Installing & configuring:
    Extract into the plugins directory. Then read CustomCrafting/recipelist.yml for further instructions.
    Changelog:
    Version 0.6
    • Damned recipe manager! Fixed all those problems with data values and stuff.
    Version 0.5

    • Now unique recipe IDs can be strings. Thanks to @Celtic Ministrel for the idea!
    • 0.5_1 bugfixed
    Version 0.4


    • Fixed data and damage.
    Version 0.3


    • Added shapeless and furnace recipes.
    • Added data and damage.
    Version 0.2


    • Fixed spaces.
    Version 0.1


    • Released.
     
    moselekm, killacalli, Flipp and 3 others like this.
  2. Offline

    Celtic Minstrel

    Data values for the result are specified with a separate key ResultData. So, taking one of your recipes as an example:

    Code:
    black wool (char)coal:
      Shape:
      - [263/-1]
      - [263/-1]
      - [35/0]
      Result: 35
      ResultData: 15
      Quantity: 1
      Type: shaped
      DataValues: true
    
    Additionally, if you have whole rows or columns empty, you'll usually want to just leave them out. In the above example, if you include the extra 0's, the recipe will only work in the leftmost column of the crafting grid; but if you leave them out it'll work in any column. Also, specify -1 as the data value to accept any data value; the above actually merges two of your recipes.

    Oh, and I don't think there would be a problem with spaces in the key; I know YAML supports them, at least.

    Could you fix this, please?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  3. Offline

    nickguletskii

    There freaking is. Thank you Celtic Minstrel, but I don't think you should have helped a person who doesn't read.
    I don't really see a reason... I only left in the ability to turn off data values for backward compatibility.
     
  4. Offline

    Celtic Minstrel

    The reason is that it's something people don't expect. For me, that's reason enough.
     
  5. Offline

    h0us3cat

    thx and no @nickguletskii there is nothing something like that in the example.yml, if so show it.
     
  6. Offline

    nickguletskii

    "#To add result data:
    # Add ResultData node, set it to the needed value."
    No, there IS.
     
  7. Offline

    Taranis01

    @nickguletskii
    did u find a possible way for replacing the standard recipes? :)
     
  8. Offline

    nickguletskii

    Not going to focus on that atm, sorry.
     
  9. Offline

    Taranis01

    :( maybe an event could be added at craftbukkit?
     
  10. Offline

    nickguletskii

    I could add the ability to remove recipes, but I am too lazy to clean up commits to match the "No 80 column limit or 'weird' midstatement newlines." rule.
     
  11. Offline

    Celtic Minstrel

    No event is needed, merely a way to match a recipe and a method that does that in order to remove it. One of the ideas I had involved basically constructing the recipe you want to remove, though, which I felt was less than ideal.
     
  12. Offline

    Taranis01

    okey, but thank you anyway
     
  13. Offline

    ValBGaming

    This is a great plugin! Works like a charm, just wondering if it'll be updated to CB #953 soon? :)

    Keep up the great work!
     
  14. Great plugin, really having fun with it.
    A quick question - would you consider allowing it to use Item ID number above 999 - i.e. 5 digit numbers please ?
    If you add a mod to minecraft that uses new ID's above 999, your plugin doesn't recognise them. Only a thought - no problem if its not possible. Thanks again.
     
  15. Offline

    nickguletskii

    It doesn't need updating. This plugin is not likely to break.
    That is weird... Not sure what to blame - the crafting manager or the mod.
     
  16. Offline

    ValBGaming

    Bit of mis-communication on my part -- I didn't mean updating the plugin -- Just the tag in the title. :p
     
  17. Offline

    Clucky

    Ok, I consider myself fairly intellectual, however I too am having problems understanding DataValues, if someone would be kind enough to explain more in depth on how to use them and maybe someone else can find my mistake, it would be greatly appreciated. I have made DataValues true for each of them, I have no spaces inside of the titles of my plugins, and from what the examples showed me, everything is correct, yet its not working. Thank you in advanced. Here's the error message:

    Code:
    03:30:56 [INFO] Loaded CustomCrafting by nickguletskii200.
    03:30:56 [SEVERE] Error occurred while enabling CustomCrafting v0.6 (Is it up to date?): java.lang.String cannot be cast to java.lang.Integer
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
        at nickguletskii200.CustomCrafting.CustomCrafting.doShaped(Unknown Source)
        at nickguletskii200.CustomCrafting.CustomCrafting.onEnable(Unknown Source)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:857)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:264)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:151)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:136)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    

    recipelist.yml
    Show Spoiler

    Code:
    #Each recipe has a unique id.
    
    #Lets have a look at a shapeless recipe.
    #8:  <-this is the unique ID.
    #  Result: 3  <-the ID of the result.
    #  Quantity: 6  <-the quantity of the result.
    #  Materials: {2: 3, 6: 2}  <-Starting materials, format: "id: quantity".
    #  Type: Shapeless  <-Define the type
    #For data values in materials, add a DataValues node (value doesn't matter) and use the following syntax:
    #{id: quantity/data, id: quantity/data...}
    #To addd result data:
    # Add ResultData node, set it to the needed value.
    #To add result damage:
    # Add ResultDamage node, set it to the needed value.
    ##example8:
    ##  Result: 256
    ##  Quantity: 6
    ##  Materials: {256: 1/127}
    ##  DataValues: abc
    ##  Type: Shapeless
    ##abc74:
    ##  Result: 256
    ##  Quantity: 6
    ##  Materials: {265/0: 1}
    ##  Type: Shapeless
    ##  ResultDamage: 251
    #Now a shaped recipe
    #3:  <-this is the unique ID.
    #  Shape:  <-do not touch this, it is a keyword.
    #  - [3, 3, 3]  <-First row of the crafting grid.
    #  - [3, 0, 3]  <-Second row of the crafting grid. Note that you can use 0s for free space.
    #  - [3, 3, 3]  <-Third row of the crafting grid.
    #  Result: 4  <-result ID
    #  Quantity: 8  <-quantity of the result
    #Note that by default, if no type is defined, the plugin will think that the recipe is shaped.
    SandstoneSand:
      Shape:
      - [24]
      Result: 12
      Quantity: 4
    #Another example of a shaped recipe, showing that the recipes don't have to fill in the whole grid.
    GrassMake:
      Shape:
      - [295/0]
      - [3/0]
      Result: 2
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainBodyMake:
      Shape:
      - [266/0, 0, 266/0]
      - [266/0, 265/0, 266/0]
      - [266/0, 265/0, 266/0]
      Result: 303
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainLegsMake:
      Shape:
      - [266/0, 265/0, 266/0]
      - [266/0, 0, 266/0]
      - [266/0, 0, 266/0]
      Result: 304
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainHelmMake:
      Shape:
      - [266/0, 265/0, 266/0]
      - [266/0, 0, 266/0]
      Result: 302
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainBootMake:
      Shape:
      - [266/0, 0, 266/0]
      - [265/0, 0, 265/0]
      Result: 305
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    SlimeballMake:
      Shape:
      - [351/10]
      - [353/0]
      - [326/0]
      Result: 341
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    StoneDoubleSlab:
      Shape:
      - [44/0]
      - [44/0]
      Result: 43
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    CobbleDoubleSlab:
      Shape:
      - [44/3]
      - [44/3]
      Result: 43
      ResultData: 3
      Quantity: 1
      Type: Shaped
      DataValues: true
    #Example of data values in shaped recipes.
    #The DataValues node's value doesn't matter - what matters is that it is there.
    #It is needed if data values are involved in the recipe.
    #Syntax:
    # - [id/data, id/data...]
    # - [id/data, id/data...]
    # - [id/data, id/data...]
    #If the item has no data values, use 0. e.g. [3/0, 3/0, 1/0]
    #To add result data:
    # Add ResultData node, set it to the needed value.
    #To add result damage:
    # Add ResultDamage node, set it to the needed value.
    ##argh33:
    ##  Shape:
    ##  - [351/1]
    ##  Result: 258
    ##  Quantity: 1
    ##  Type: Shaped
    ##  ResultDamage: 1
    ##  DataValues: abc
    #A furnace recipe.
    #99:
    #  Result: 264  <-result ID
    #  Quantity: 1  <-quantity of the result
    #  Source: 263  <-the ID of the material to be smelted
    #  Type: Furnace <-type definition
    #For result data use the ResultData node (optional).
    #For result damage use the ResultDamage node (optional).
    #For now, source data is broken.
    ##abc99:
    ##  Result: 351
    ##  ResultData: 3
    ##  Quantity: 1
    ##  Source: 351
    ##  SourceData: 1
    ##  Type: Furnace
    #CREDIT GOES TO FULLWALL, THE AUTHOR OF COOKBOOK!
    #Repair recipe. Set the source data value to -1!
    ##ewqer8:
    ##  Result: 256
    ##  Quantity: 1
    ##  Materials: {256: 1/-1, 265/0: 1/0}
    ##  DataValues: abc
    ##  Type: Shapeless
    


    Knowing myself, I probably did something stupid like forgot a space, or added a space, or pressed a wrong key...
     
  18. Well, I can craft anything on the new mod I've added with ID's in the 200's, but as soon as I try with Item number in the 29000 range, nothing happens. There is no error, just nothing crafts ? That's why I assumed if you went over a 3 digit number, it wouldn't work with that size of number ? I could be wrong......
     
  19. Offline

    Celtic Minstrel

    @Clucky – Add a /0 after all your 0's.
     
  20. Offline

    Clucky

    Thanks for the help, but im still getting the error, heres my updated one:

    Code:
    #Each recipe has a unique id.
    
    #Lets have a look at a shapeless recipe.
    #8:  <-this is the unique ID.
    #  Result: 3  <-the ID of the result.
    #  Quantity: 6  <-the quantity of the result.
    #  Materials: {2: 3, 6: 2}  <-Starting materials, format: "id: quantity". 
    #  Type: Shapeless  <-Define the type
    #For data values in materials, add a DataValues node (value doesn't matter) and use the following syntax:
    #{id: quantity/data, id: quantity/data...}
    #To addd result data:
    # Add ResultData node, set it to the needed value.
    #To add result damage:
    # Add ResultDamage node, set it to the needed value.
    ##example8:
    ##  Result: 256
    ##  Quantity: 6
    ##  Materials: {256: 1/127}
    ##  DataValues: abc
    ##  Type: Shapeless
    ##abc74:
    ##  Result: 256
    ##  Quantity: 6
    ##  Materials: {265/0: 1}
    ##  Type: Shapeless
    ##  ResultDamage: 251
    #Now a shaped recipe
    #3:  <-this is the unique ID.
    #  Shape:  <-do not touch this, it is a keyword.
    #  - [3, 3, 3]  <-First row of the crafting grid.
    #  - [3, 0/0, 3]  <-Second row of the crafting grid. Note that you can use 0/0s for free space.
    #  - [3, 3, 3]  <-Third row of the crafting grid.
    #  Result: 4  <-result ID
    #  Quantity: 8  <-quantity of the result
    #Note that by default, if no type is defined, the plugin will think that the recipe is shaped.
    SandstoneSand:
      Shape:
      - [24]
      Result: 12
      Quantity: 4
    #Another example of a shaped recipe, showing that the recipes don't have to fill in the whole grid.
    GrassMake:
      Shape:
      - [295/0]
      - [3/0]
      Result: 2
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainBodyMake:
      Shape:
      - [266/0, 0/0, 266/0]
      - [266/0, 265/0, 266/0]
      - [266/0, 265/0, 266/0]
      Result: 303
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainLegsMake:
      Shape:
      - [266/0, 265/0, 266/0]
      - [266/0, 0/0, 266/0]
      - [266/0, 0/0, 266/0]
      Result: 304
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainHelmMake:
      Shape:
      - [266/0, 265/0, 266/0]
      - [266/0, 0/0, 266/0]
      Result: 302
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    ChainBootMake:
      Shape:
      - [266/0, 0/0, 266/0]
      - [265/0, 0/0, 265/0]
      Result: 305
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    SlimeballMake:
      Shape:
      - [351/10]
      - [353/0]
      - [326/0]
      Result: 341
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    StoneDoubleSlab:
      Shape:
      - [44/0]
      - [44/0]
      Result: 43
      ResultData: 0
      Quantity: 1
      Type: Shaped
      DataValues: true
    CobbleDoubleSlab:
      Shape:
      - [44/3]
      - [44/3]
      Result: 43
      ResultData: 3
      Quantity: 1
      Type: Shaped
      DataValues: true
    #Example of data values in shaped recipes.
    #The DataValues node's value doesn't matter - what matters is that it is there.
    #It is needed if data values are involved in the recipe.
    #Syntax:
    # - [id/data, id/data...]
    # - [id/data, id/data...]
    # - [id/data, id/data...]
    #If the item has no data values, use 0/0. e.g. [3/0, 3/0, 1/0]
    #To add result data:
    # Add ResultData node, set it to the needed value.
    #To add result damage:
    # Add ResultDamage node, set it to the needed value.
    ##argh33:
    ##  Shape:
    ##  - [351/1]
    ##  Result: 258
    ##  Quantity: 1
    ##  Type: Shaped
    ##  ResultDamage: 1
    ##  DataValues: abc
    #A furnace recipe.
    #99:
    #  Result: 264  <-result ID
    #  Quantity: 1  <-quantity of the result
    #  Source: 263  <-the ID of the material to be smelted
    #  Type: Furnace <-type definition
    #For result data use the ResultData node (optional).
    #For result damage use the ResultDamage node (optional).
    #For now, source data is broken.
    ##abc99:
    ##  Result: 351
    ##  ResultData: 3
    ##  Quantity: 1
    ##  Source: 351
    ##  SourceData: 1
    ##  Type: Furnace
    #CREDIT GOES TO FULLWALL, THE AUTHOR OF COOKBOOK!
    #Repair recipe. Set the source data value to -1!
    ##ewqer8:
    ##  Result: 256
    ##  Quantity: 1
    ##  Materials: {256: 1/-1, 265/0: 1/0}
    ##  DataValues: abc
    ##  Type: Shapeless
    (Might this have to do with me running it on 953? It worked before I started using datavalues that's what is strange...)
     
  21. Offline

    nickguletskii

    -_- Is it really that hard? When there are data values, all material nodes are of format id/data. When there are not, all material nodes are of format id.
     
  22. Offline

    Clucky

    Yes, it kinda is; however, somehow it managed to fix itself... I don't quite know how, I never edited it after that last post... I'm assuming it may have been a confliction?
     
  23. Offline

    Celtic Minstrel

    Yes, it really is that hard. And changing the plugin so people don't have to worry about that is a simple task, just get it as a string, check if it contains "/", and move on pretty much as you already do.
     
  24. Offline

    nickguletskii

    I know it is simple for me, but I don't want to change it just because I find it stupid that people don't even read.
     
  25. Offline

    Celtic Minstrel

    I don't see that being a good reason. Yes, it's stupid that they don't read, but deliberately leaving it obtuse to force them to read will just get you more queries of "why doesn't this work" when they, predictably, don't read anyway.
     
  26. Does it work with CB953?
     
  27. Offline

    nickguletskii

    Yeah.
     
  28. Offline

    Taranis01

    i just found this: http://forums.bukkit.org/threads/misc-nocraft-v0-1-disable-certain-crafting-recipes-935.22272/
    i will try using it together with customcrafting - even i dont really like installig another plugin

    @nickguletskii
    suggestion: a new variable for restricting a recipe to a permission group (thinking about it, maybe someone would need a way for restricting to a world too?)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  29. Offline

    Celtic Minstrel

    That appears to remove them based on the resulting item, which certainly works but doesn't provide a way to remove just one recipe when there are two that make the same thing.

    Also, permissions are not possible with how he has done this.
     
  30. Offline

    Taranis01

    okey, not the solution i search.
    the permissions part was meant for CustomCrafting and not NoCraft ^^
     
  31. Offline

    Celtic Minstrel

    I guessed as much, and replied with that in mind. Sorry for the ambiguity.
     

Share This Page