import com.google.gson.Gson; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; import java.io.IOException; import java.util.Arrays; import java.util.Base64; import java.util.UUID; import InventoryGet.*; public class InventorySync extends JavaPlugin implements Listener { String saveInv = "192.168.137.38:4443/saveInv.php"; String loadInv = "192.168.137.38:4443/loadInv.php"; Gson gson = new Gson(); @EventHandler public void onJoin(PlayerJoinEvent event) throws IOException { Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); //InventoryGet.main(loadInv + "?username=" + uuid.toString()); } @EventHandler public void onQuit(PlayerQuitEvent event) throws IOException { Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); Object[] contents = Arrays.stream(player.getInventory().getContents()).toArray(); String inv = Base64.getEncoder().encodeToString( gson.toJson(contents).getBytes() ); InventoryGet.main(saveInv + "?username=" + uuid.toString() + "&inventory=" + inv); System.out.print("123"); } }
напишите что я сделал не так