/hub plugin for BungeeCord won't work help

Discussion in 'Plugin Development' started by Bluestormer31, Jun 14, 2019.

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

    Bluestormer31

    I think the topic sais it all, my code is here:
    Code:
    package de.stephen.HubCommand.main;
    
    import java.io.ByteArrayOutputStream;
    import java.io.DataOutputStream;
    import java.io.IOException;
    import org.bukkit.Bukkit;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.plugin.messaging.PluginMessageListener;
    
    
    public class Main extends JavaPlugin implements Listener{
      
        public void onEnable() {
               this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
                this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord",(PluginMessageListener) this);
                getCommand("hub").setExecutor(new command());
            Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
        }
        public class command extends Main implements CommandExecutor{
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {      
            if(sender instanceof Player) {
                Player p = (Player) sender;
              
                  ByteArrayOutputStream b = new ByteArrayOutputStream();
                  DataOutputStream out = new DataOutputStream(b);
                  try {
                    out.writeUTF("Connect");
                    out.writeUTF("lobby");
                  } catch (IOException e) {
                    e.printStackTrace();
                  }
                  p.sendPluginMessage(this, "BungeeCord", b.toByteArray());
                }
    
                return true;
            
            }
        }
    }
    
    --------------------------------------------------------------------------------------------------------------------------------
    log:
    Code:
    [16:30:53] [Server thread/INFO]: Starting minecraft server version 1.12
    [16:30:53] [Server thread/WARN]: To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
    [16:30:53] [Server thread/INFO]: Loading properties
    [16:30:53] [Server thread/INFO]: Default game type: SURVIVAL
    [16:30:54] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-596221b-9a1fc1e (MC: 1.12) (Implementing API version 1.12-R0.1-SNAPSHOT)
    [16:30:54] [Server thread/INFO]: Debug logging is disabled
    [16:30:54] [Server thread/INFO]: Server Ping Player Sample Count: 12
    [16:30:54] [Server thread/INFO]: Using 4 threads for Netty based IO
    [16:30:54] [Server thread/INFO]: Generating keypair
    [16:30:54] [Server thread/INFO]: Starting Minecraft server on *:25566
    [16:30:54] [Server thread/INFO]: Using default channel type
    [16:30:54] [Server thread/INFO]: Set PluginClassLoader as parallel capable
    [16:30:54] [Server thread/INFO]: [HubCommand] Loading HubCommand vAlpha 0.1
    [16:30:54] [Server thread/INFO]: [PersonalMassage] Loading PersonalMassage v0.1
    [16:30:54] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    [16:30:54] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
    [16:30:54] [Server thread/WARN]: Whilst this makes it possible to use BungeeCord, unless access to your server is properly restricted, it also opens up the ability for hackers to connect with any username they choose.
    [16:30:54] [Server thread/WARN]: Please see [URL]http://www.spigotmc.org/wiki/firewall-guide/[/URL] for further information.
    [16:30:54] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
    [16:30:54] [Server thread/INFO]: **** Beginning UUID conversion, this may take A LONG time ****
    [16:30:54] [Server thread/INFO]: Preparing level "hub"
    [16:30:54] [Server thread/INFO]: -------- World Settings For [hub] --------
    [16:30:54] [Server thread/INFO]: Item Despawn Rate: 6000
    [16:30:54] [Server thread/INFO]: Item Merge Radius: 2.5
    [16:30:54] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [16:30:54] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [16:30:54] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [16:30:54] [Server thread/INFO]: Experience Merge Radius: 3.0
    [16:30:54] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [16:30:54] [Server thread/INFO]: View Distance: 10
    [16:30:54] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Cane Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Melon Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Vine Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [16:30:54] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [16:30:54] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [16:30:54] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1
    [16:30:54] [Server thread/INFO]: Random Lighting Updates: false
    [16:30:54] [Server thread/INFO]: Structure Info Saving: true
    [16:30:54] [Server thread/INFO]: Max TNT Explosions: 100
    [16:30:54] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [16:30:54] [Server thread/INFO]: Mob Spawn Range: 4
    [16:30:54] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617 Monument: 10387313 Slime: 987234911
    [16:30:55] [Server thread/INFO]: -------- World Settings For [hub_nether] --------
    [16:30:55] [Server thread/INFO]: Item Despawn Rate: 6000
    [16:30:55] [Server thread/INFO]: Item Merge Radius: 2.5
    [16:30:55] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [16:30:55] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [16:30:55] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [16:30:55] [Server thread/INFO]: Experience Merge Radius: 3.0
    [16:30:55] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [16:30:55] [Server thread/INFO]: View Distance: 10
    [16:30:55] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Cane Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Melon Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Vine Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [16:30:55] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [16:30:55] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1
    [16:30:55] [Server thread/INFO]: Random Lighting Updates: false
    [16:30:55] [Server thread/INFO]: Structure Info Saving: true
    [16:30:55] [Server thread/INFO]: Max TNT Explosions: 100
    [16:30:55] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [16:30:55] [Server thread/INFO]: Mob Spawn Range: 4
    [16:30:55] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617 Monument: 10387313 Slime: 987234911
    [16:30:55] [Server thread/INFO]: -------- World Settings For [hub_the_end] --------
    [16:30:55] [Server thread/INFO]: Item Despawn Rate: 6000
    [16:30:55] [Server thread/INFO]: Item Merge Radius: 2.5
    [16:30:55] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [16:30:55] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [16:30:55] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [16:30:55] [Server thread/INFO]: Experience Merge Radius: 3.0
    [16:30:55] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [16:30:55] [Server thread/INFO]: View Distance: 10
    [16:30:55] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Cane Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Melon Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Vine Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [16:30:55] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [16:30:55] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [16:30:55] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1
    [16:30:55] [Server thread/INFO]: Random Lighting Updates: false
    [16:30:55] [Server thread/INFO]: Structure Info Saving: true
    [16:30:55] [Server thread/INFO]: Max TNT Explosions: 100
    [16:30:55] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [16:30:55] [Server thread/INFO]: Mob Spawn Range: 4
    [16:30:55] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617 Monument: 10387313 Slime: 987234911
    [16:30:55] [Server thread/INFO]: Preparing start region for level 0 (Seed: -7460576736882053312)
    [16:30:55] [Server thread/INFO]: Preparing start region for level 1 (Seed: 825876375340051097)
    [16:30:56] [Server thread/INFO]: Preparing start region for level 2 (Seed: 825876375340051097)
    [16:30:57] [Server thread/INFO]: [HubCommand] Enabling HubCommand vAlpha 0.1
    [16:30:57] [Server thread/ERROR]: Error occurred while enabling HubCommand vAlpha 0.1 (Is it up to date?)
    java.lang.ClassCastException: de.stephen.HubCommand.main.Main cannot be cast to org.bukkit.plugin.messaging.PluginMessageListener
        at de.stephen.HubCommand.main.Main.onEnable(Main.java:20) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:402) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:374) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:323) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:421) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:382) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:337) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:544) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]
    [16:30:57] [Server thread/INFO]: [PersonalMassage] Enabling PersonalMassage v0.1
    [16:30:57] [Server thread/INFO]: Hallo, willkommen zurück auf deinem SPIGOT 1.12 Server!
    [16:30:57] [Server thread/WARN]: Could not register alias hub because it contains commands that do not exist: server lobby
    [16:30:57] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [16:30:57] [Server thread/INFO]: Done (2,386s)! For help, type "help" or "?"
    [16:31:05] [Server thread/INFO]: Stopping the server
    [16:31:05] [Server thread/INFO]: Stopping server
    [16:31:05] [Server thread/INFO]: [PersonalMassage] Disabling PersonalMassage v0.1
    [16:31:05] [Server thread/INFO]: Auf wiedersehen, bis zum nächsten mal
    [16:31:05] [Server thread/INFO]: [HubCommand] Disabling HubCommand vAlpha 0.1
    [16:31:05] [Server thread/INFO]: Saving players
    [16:31:05] [Server thread/INFO]: Saving worlds
    [16:31:05] [Server thread/INFO]: Saving chunks for level 'hub'/overworld
    [16:31:06] [Server thread/INFO]: Saving chunks for level 'hub_nether'/the_nether
    [16:31:06] [Server thread/INFO]: Saving chunks for level 'hub_the_end'/the_end
     
    Last edited by a moderator: Jun 14, 2019
  2. Offline

    timtower Ninja on the waves Moderator

    Locked
    Bungeecord requires offline mode
    Offline mode is not supported by Bukkit
     
Thread Status:
Not open for further replies.

Share This Page