MaterialAPI - Create new items and blocks!

Discussion in 'Resources' started by Cybermaxke, Jan 19, 2013.

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

    Cjreek

    Will there be new versions of this where those bugs are fixed?
     
  2. Offline

    Cybermaxke

    I will also use my old method to store data:
    - A custom enchantment (So the glow effect.)
    - One bug: minecraft client crashes with a anvil using a custom item. (I will see if I can fix it.)

    This should fix the other problems but contains a other bug, it would be better if there was a nbt tag api.
     
    Derthmonuter likes this.
  3. Offline

    Derthmonuter

    Thanks for taking on this project Cybermaxke, I can't wait to use it.
     
  4. Offline

    lucasdidur

    Hello,

    I'ts possible to create a chest with slab texture? And thend when right click open the inventory?
     
  5. Offline

    Cybermaxke

    You can make the player opening a inventory when interacting with a slab. ;)
     
  6. Offline

    lucasdidur

    But I want use getBlockInventory(), so that I do not need to create a method to save the inventory.
     
  7. Offline

    drampelt

    Is there any way to change blocks in the world into a CustomMaterial block without having a user place it?
     
  8. Offline

    Cybermaxke

    You can use a method in MaterialData to set it.
     
  9. Offline

    Cybermaxke

    Update
    - The changes I said before.
    - Made a small api to save custom data to blocks. (Since the metadata of bukkit was lost on disable.)
    - Minor changes/fixes.
     
  10. Offline

    MastaC

    How would one go about loading a CustomItemStack from a yamlconfiguration?

    Edit: Ahh, think I have figured it out!

    Code:
    ItemStack item = new ItemStack(config().getItemStack(
                            "inventory." + i));
                    if (MaterialData.isCustomItem(item)) {
                        CustomItemStack custitem = new CustomItemStack(
                                MaterialData.getMaterialByCustomId(MaterialData
                                        .getCustomId(item)));
                        player.getInventory().setItem(i, custitem);
                    } else { //If not a custom item, set the regular ItemStack
                        player.getInventory().setItem(i, item);
                    }
     
  11. Offline

    xxNightlordx

    How do you set custom IDs?
     
  12. Offline

    Cybermaxke

    The ids are automatic assigned to a material, but you can't change it by default. Or if you mean changing the material of a itemstack, its also not possible yet cause things will be messed up.
     
  13. Offline

    xxNightlordx

    I don't understand the shaped Crafting code.:( Can someone explain it to me.
     
  14. Does Anyone have a sample complete code I could look off of?
     
  15. Offline

    TheGamersCave

    I wish this could get updated to 1.5, I've coded a weapons generation library with this and I'd like it to not be buggy in 1.5 :p
     
  16. Offline

    Cybermaxke

    Update:
    - Added TagUtils (Allosw custom tags for a itemstack, chunks.
    - Updated the ChunkData to use the TagUtils to save data.
    - No longer need of ProtocolLib to hide the id.
    - CustomItemStack no longer extends ItemStack. (Will break stuff.)
    - Some Maven changes.
     
  17. Offline

    TheGamersCave

    Thank you SO much dude! For a while I was using a "makeshift" version of your plugin, as I assumed it was abanded, went ahead and did a rough update, and it worked for a bit :p

    Thanks again, Cyber! I really appreciate you spending your time to make this, It's helped me, and other a huge amount :)
    If there's any way I can help, or maybe send a donation to keep the plugin up to date, I will :D
     
  18. Offline

    Brendyn Todd

    Is there a way to use custom items in a recipe for another custom item?


    Also, it seems effects no longer work, even with your working example.
     
  19. Offline

    SugarCraft

    The constructor CustomMaterial(int, Material) is undefined ?
     
  20. Offline

    tincopper2

    You should have told us that the source was a different version than the current. Thou hast mislead me.

    Can I have the source for the version that has a boolean on the addEnchantment?

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

    Cybermaxke

    What boolean?
     
  22. Offline

    tincopper2

    The true or false for whether or not it's displayed.
     
  23. Offline

    Cybermaxke

    I removed that since I removed the depency of ProtocolLib, was also bugged.
     
  24. Offline

    tincopper2

    can you add me on skype since you're online now, Ive been straining over this concept for days now and I need to resolve myself... if that makes any sense. im tincopper2
     
  25. Offline

    Brendyn Todd

    Could there be a possible way to have mobs drop custom items? If so how would I go about doing this?
     
  26. Offline

    Brendyn Todd

    Does MaterialAPI create some problems with Furnaces? I noticed my furnaces were not properly smelting items and upon removing MaterialAPI the problem ceased.

    Hopefully this can be fixed in the next release?
     
  27. Offline

    Hoolean

    Cybermaxke

    Hello there! I'm thinking of using this plugin for a few plugins for my server and would love to see a few screenshots first (as I'm a lazy bastard ;) ) just to see how the map rendering works? I think me and other developers would appreciate it :D
     
  28. Offline

    Flemingjp

    Hmmm, the .setLore() isn't working for me. Am i doing something wrong?

    Code:java
    1.  
    2. @Override
    3. public void onInteract(PlayerInteractEvent e) {
    4. Action a = e.getAction();
    5. CustomItemStack ci = new CustomItemStack(e.getPlayer().getItemInHand());
    6.  
    7. //RightClick
    8. if(a.equals(Action.RIGHT_CLICK_AIR) || a.equals(Action.RIGHT_CLICK_BLOCK)) {
    9. if(!ci.hasLore()) {;
    10. ci.setLore("LORE");
    11. }
    12. }
    13. }
    14.  


    The item doesnt get a lore. It remains blank.

    Thanks, Flemingjp
     
  29. Offline

    Flemingjp

    Any help? Anyother way of adding a lore make isCustomItem() return false.
     
  30. Offline

    SugarCraft

    Flemingjp Replace @Override with @EventHandler
     
Thread Status:
Not open for further replies.

Share This Page