Internal Exception on Join

Discussion in 'Plugin Development' started by greaperc4, Dec 3, 2013.

Thread Status:
Not open for further replies.
  1. Hello,
    I made some code that will kick you when joining the server
    but it won't show the message I put in
    It will tell me:
    - Internal Exception: Java.lang.ClassCastException: bjq cannot be cast to fm.

    and in the console it will just tell me:
    - [11:27:21 INFO]: greaperc4 lost connection: Sorry this server is Whitelisted.
     
  2. Offline

    NoLiver92

    What is your code? and the error stack trace?

    What you have told us so far is as much use as a holey bucket.
     
  3. Code:java
    1.  
    2. @Override
    3. public void onEnable() {
    4. this.getLogger().info("Enabled");
    5. getServer().getPluginManager().registerEvents(this, this);
    6. }
    7.  
    8. @Override
    9. public void onDisable() {
    10. this.getLogger().info("Disabled");
    11. }
    12.  
    13. @EventHandler
    14. public void onJoin(PlayerJoinEvent event) {
    15. Player player = event.getPlayer();
    16. if (!player.isOp()) {
    17. player.kickPlayer("Sorry this server is Whitelisted");
    18. }
    19. }
     
  4. Offline

    NoLiver92

    That is the message you set:
    Code:java
    1. player.kickPlayer("Sorry this server is Whitelisted");


    for the internal exception...
    what is the line of code which is causing the error? look at the stack trace and post it here
     
  5. you have not read what I said...... The console said:
    - [11:27:21 INFO]: greaperc4 lost connection: Sorry this server is Whitelisted.

    and the client only said:
    - Internal Exception: Java.lang.ClassCastException: bjq cannot be cast to fm.

    There is no error line
     
  6. Offline

    NoLiver92

    I did read what you said and i have tried it on my own server, the code works perfectly fine. the lost connection is correct!! thats the message you will get. Are you using the right versions of mc client and server? have you modified the client?

    There is nothing wrong with this code you have posted:
    Code:java
    1. @Override
    2. public void onEnable() {
    3. this.getLogger().info("Enabled");
    4. getServer().getPluginManager().registerEvents(this, this);
    5. }
    6.  
    7. @Override
    8. public void onDisable() {
    9. this.getLogger().info("Disabled");
    10. }
    11.  
    12. @EventHandler
    13. public void onJoin(PlayerJoinEvent event) {
    14. Player player = event.getPlayer();
    15. if (!player.isOp()) {
    16. player.kickPlayer("Sorry this server is Whitelisted");
    17. }
    18. }
     
  7. wouw.... thanks..
    Used the last version of minecraft.. that's gonna be annoying
     
  8. Offline

    NoLiver92

    greaperc4
    I have just downloaded the recent one 40 mins ago and it worked on that, it may be a bug in one of the files as the original one i used didnt display anything to the console window
     
  9. Offline

    deadanykey

     
Thread Status:
Not open for further replies.

Share This Page