Splegg Minigame icon

Splegg Minigame -----

Spleef Mode | Powerups | Bungee/MultiArena | Extremely Configurable | Spleef Mode | Cosmetics |



API Update
  • Fixed auto-join sign bugs.
  • API & System changes
    • forwardData
      • You can now forward data to servers using the API, this method will able you to send rewards or any data you want between servers..
      • Subchannel is named Splegg.
      • Key is any value you want, e.g you can use "winner" to identify that the data is from the winner.
      • I recommend you adding a delay to send data.
    • If you don't like how it works, you can do your own method using the Game Events on API.
Sending data
Code (Text):
@EventHandler
    public void onGameEnd(GameEndEvent e) {
        Player winner = e.getWinner();
        if(Splegg.getAPI().forwardData(winner, "ALL", "winner")) {
            Bukkit.getLogger().info("Data sent.");
        }
    }
 
Receiving data
Code (Text):
@Override
    public void onPluginMessageReceived(String channel, Player player, byte[] message) {
        if (!channel.equals("BungeeCord")) {
            return;
        }
   
        try{
          DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
            String subchannel = in.readUTF();
            if (subchannel.equals("Splegg")) {
                short len = in.readShort();
                byte[] data = new byte[len];
                in.readFully(data);
                String s = new String(data);
                //player:key/server
                Bukkit.getLogger().info(s);
           
                String playerName = StringUtils.substringBefore(s, ":");
                String key = StringUtils.substringBefore(s, "/").substring(playerName.length()+1);    
                String server =  StringUtils.substringAfter(s, "/");
           
                Bukkit.getLogger().info("Server: " + server);
                Bukkit.getLogger().info("Key: " + key);
                Bukkit.getLogger().info("Player: " + playerName);
            }
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
----------, Oct 3, 2017
Resource Information
Author:
----------
Total Downloads: 158
First Release: Jul 28, 2016
Last Update: Feb 2, 2025
Category: ---------------
All-Time Rating:
22 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings