Need help maintaining a plugin that uses nms/obc code

Discussion in 'Plugin Development' started by |Anthony|, Dec 4, 2013.

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

    |Anthony|

    Thank you for taking the time to read this post.​

    I've been attempting to maintain NoItem for quite some time now, and have been able to keep the plugin functional with the occasional help from some kind devs in the minecraft community. The update to 1.7.2 is another one of those occasions and i am now humbly asking for your assistance.

    You can see the compilation errors here and the corresponding code here to deduce the issue. I'm not a java developer by any stretch of the imagination and none of that info makes any sense to me. I've been lucky to be able to do the bare minimum to keep this plugin functional.

    I greatly appreciate your help.
     
  2. Offline

    1Rogue

    Your errors are because the nms code doesn't have those fields you are using. Item ID's are being deprecated for the future, so this is probably a part of that.

    If you don't understand java itself you really shouldn't be playing with the nms internals. Most of your issue is that you just need to fix up how you check items via id's.
     
  3. Offline

    DrkMatr1984

    They're definitely NOT deprecated yet. I've been using them lately in some 1.7.2 code. I'll clone your repo and see what I can do for you.
     
  4. Offline

    |Anthony|

    I completely agree, which is why i'm hoping that someone who is qualified to endeavor such an edit is kind enough to do so. I'm in a situation where i need to keep this plugin functional, not only for myself, but for other folks that use it too. The original author had been away from the project for quite a few mc updates and i did what i was able to do to maintain the project. He had subsequently granted me author status of the project since i had been helping users along the way and had been keeping updated versions available on jenkins.
     
  5. Offline

    Bart

    Hey,

    This may or may not be helpful but I looked at your latest commit and you should be able to remove the dependency on NMS by changing some of the code around.

    Referring to this,
    https://github.com/MineConomy/NoItem/commit/9710878a5e08f87c10505274d52030e9313f8da0

    The part that requires NMS is to check whether an ItemStack is fuel. This can be done without NMS using the following:
    Code:java
    1. itemstack.getType().isBurnable();


    I understand that this isn't a solution to the problem but from what I can tell, everything would become a lot easier if you can avoid using NMS altogether.

    Thanks,
    Bart

    EDIT: Tahg |Anthony|
     
    NathanWolf likes this.
  6. Offline

    |Anthony|

    I'm all for removing nms/obc dependency. As i recall, nala3 had needed that for potion control. If there's a way to do it with out the dep, i'm all ears.
     
    DrkMatr1984 likes this.
  7. Offline

    DrkMatr1984

    Just change it to cursor.getTypeId() == 373 and if(item.getTypeId() == 373) since the typeID of a potion is 373 anyway. It was only grabbing the TypeID from the minecraft item.class which registers it and the number hasn't changed. They got rid of the .id function which is what is screwing you up. You can do what Bart said to fix that problem, but I think you can just insert the itemstack in there instead of the typeid by doing this
    return RecipesFurnace.getInstance().getResult(nmss) != null;
    to see if it burns.
    Hope that helps, as for your problems with NMS methods, not too sure :p

    return itemstack == null ? i : (itemstack.usesData() ? PotionBrewer.a(i, itemstack.a()) : i);
    Maybe that will work.

    That get's it to compile but you'll have to test it and make sure it still does what it's supposed to.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
Thread Status:
Not open for further replies.

Share This Page