GUI Functional Anvil

Discussion in 'Plugin Requests' started by D3adSh0t04, May 23, 2016.

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

    D3adSh0t04

    Hi i need a Plugin named CustomAnvil (just a sugg you can put any name on it) that with a command ( /anvil ) the anvil GUI popup and works like a normal anvil, also make some changes on the anvil mechanics, i need to set the Max level of repair to 60, so doesnt matter how many times a repair something, it cant go up than 60 lvls.
    I dont know if it matter but i need to work on 1.8.8
    Im asking help because im lost, i know how to make the Anvil GUI but im stell learning, so if some one can help me with this please.
     
  2. Offline

    D3adSh0t04

    Yea, basically i want it on a GUI because i dont think its possible remove the "To Expensive" message on the normal Anvil, so i was thinking its more easy just make a plugin with the GUI and copy the code of the Minecraft default anvil and change stuff there and just put a max lvl of xp for reapair something, but i really dont know whats more easy/possible
     
  3. Offline

    pie_flavor

    @D3adSh0t04 That's not how inventories work. Inventories are hardcoded into Minecraft, and with the exception of chest inventories having customizable numbers of rows, no inventory can be edited. You can't just create a new inventory and 'copy the code over'. The Too Expensive limit cannot be overcome.
     
  4. Online

    timtower Administrator Administrator Moderator

    @pie_flavor We can however mimic the functionality.
     
  5. Offline

    D3adSh0t04

    @pie_flavor as @timtower saids maybe you cant do the "copy paste" the code of the minecraft anvil, but you can mimic it, heres an idea of how "maybe" you can make it work (im not an expert of minecraft plugin code):
    1. Set up the anvil GUI
    2. On the first slot (whre you put the item you want to repair) place the item adn detect the material (iron,diamond,etc)
    3. And the second slot put the item with you want to repair it (diamonds, iron ingots, or even a sword)
    4. Then setup custom repair lvls for the item like 100% fixed its gonna be 60 lvls(max), 80% fixed 50 lvls and so
    5. Then instead of draggin the item from the last slot just click it, and make the plugin search in the inventory of the player the used item and delete it also the item used for repair it, and give the player the same item, example (the same swords with all the enchantems that the used sword has), and take away the lvls

    I dont know if you can understand my explanation sorry if you dont, but thats just an idea, i know theres alor of people that know this better than i so, i found some plugin kind similar to the what i want
    This one: http://minecraft.curseforge.com/projects/better-anvils BUT only works with Forge, if anyone can make it work on a server without forge or just look the code and get some ideas from there
     
  6. Online

    timtower Administrator Administrator Moderator

    @D3adSh0t04 That is a mod.
    They have have access to the client itself, we don't.
    I never said that we could copy the code, I said that we could recreate its functionality.
     
  7. Offline

    pie_flavor

    @D3adSh0t04 Again, the only 'custom' inventory we can make is a chest inventory of customizable row count. Other than that, all we can do is show you existing inventories. AFAIK anvil prices also cannot be reworked, at least not in a way exposed to the Bukkit API. And the client is the one that decides that it is Too Expensive, and won't put an item in the last slot.
    Anvils as a whole aren't really represented well in Bukkit. What @timtower is suggesting is that an inventory other than an anvil is used, likely a hopper or a one-row chest, and the processing part is mimicked.
     
    timtower likes this.
  8. Offline

    I Al Istannen

    @D3adSh0t04
    So you just want to remove the additional repair costs? If so, this might help you. It prevents the repair from getting costlier, if you do it multiple times. It has no cap however.
     
Thread Status:
Not open for further replies.

Share This Page