error: no suitable constructor found for

后端 未结 2 826
感情败类
感情败类 2020-12-11 11:53

I am new to java, and am trying to make a mod for Minecraft, but I can\'t figure out how I can fix this error:

src\\minecraft\\net\\minecraft\\src\\ThreadCon         


        
相关标签:
2条回答
  • 2020-12-11 12:03
    new Packet2ClientProtocol(51, GuiConnecting.func_74254_c(this.connectingGui), this.Username, this.ip, this.port)
    

    The error indicates that such a constructor does not exist.

    There are only 2 options

    Packet2ClientProtocol.Packet2ClientProtocol(int,String,int)
    Packet2ClientProtocol.Packet2ClientProtocol()
    
    0 讨论(0)
  • 2020-12-11 12:17

    The Java compiler is telling you that cannot construct a Packet2ClientProtocol object, because your call to the constructor does not match any known constructor.

    Specifically, the compiler found two constructors:

    Packet2ClientProtocol.Packet2ClientProtocol(int,String,int)
    Packet2ClientProtocol.Packet2ClientProtocol()
    

    but your call to:

    new Packet2ClientProtocol(51, GuiConnecting.func_74254_c(this.connectingGui), this.Username, this.ip, this.port)
    

    matches none of them.

    0 讨论(0)
提交回复
热议问题