Outdated Plugin Extending NMS Classes - Missing Methods

Discussion in 'Spigot Plugin Development' started by BatSham, May 26, 2019.

  1. Hello everyone!

    Essentially, I am having a lot of trouble updating this plugin, and a lot of the issues seem to be with finding some of the methods and things that have likely changed over the years (This plugin was last made for 1.8). Some of the Override tags work correctly, but since I am pretty new to coding plugins, I don't know how to tell if these methods simply don't exist anymore or have just been renamed. I will post some of the examples below, and the issue with each is listed as "method does not override or implement a method from a supertype."

    *Extends Container*
    Code (Java):
    @Override
        //Called when this display is showing
    public boolean a(EntityHuman entityhuman) {
        ((EntityPlayer) human).a(human.activeContainer, human.activeContainer.a());
        return true;
    }

    @Override
        //Called when shift clicking an item into this inventory.
    public ItemStack b(EntityHuman entityhuman, int index) {
        //buncha code
    }
    *Extends EntityGiantZombie*
    Code (Text):
    @Override
        protected void bj() {
            motY = 0.46D * ConfigEntries.GIANT_JUMP_MULTIPLIER.<Double> getValue();
            if (hasEffect(MobEffectList.JUMP)) {
                motY += (getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F;
            }
            if (isSprinting()) {
                float f = yaw * 0.01745329F;
                motX -= MathHelper.sin(f) * 0.2F;
                motZ += MathHelper.cos(f) * 0.2F;
            }
            al = true;
        }
    I'm honestly not sure if some of this code needs completely rewritten, I have tried to migrate some methods (especially the ones dealing with items) from NMS to Bukkit, but there are a lot in the plugin that don't have an alternative, like custom pathfinding. I appreciate any and all advice you pros out there can give me!
     
  2. what about decompiling the spigot file and check the class to get the content that is inside and the methods that exists / have to be overwritten.
     
  3. No need to decompile spigot since you can get the source when you build it using BuildTool.
     
  4. yea, or on that way
     
  5. I am able to see the source code for the classes that are referenced (even if it is still partly obfuscated), I've been looking at them in the craftbukkit files, but I'm just not sure what to do about the methods that aren't there anymore