This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Created by Justis Root. Released into the public domain. | |
//https://gist.github.com/justisr/7a7449adac931a066c51/ | |
// | |
//Source is licensed for any use, provided that this copyright notice is retained. | |
//Modifications not expressly accepted by the author should be noted in the license of any forks. | |
//No warranty for any purpose whatsoever is implied or expressed, | |
//and the author shall not be held liable for any losses, direct or indirect as a result of using this software. | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Locale; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.URLClassLoader; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.nio.file.Path; | |
/** | |
* Example demonstrating a ClassLoader leak. | |
* | |
* <p>To see it in action, copy this file to a temp directory somewhere, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts the player inventory to a String array of Base64 strings. First string is the content and second string is the armor. | |
* | |
* @param playerInventory to turn into an array of strings. | |
* @return Array of strings: [ main content, armor content ] | |
* @throws IllegalStateException | |
*/ | |
public static String[] playerInventoryToBase64(PlayerInventory playerInventory) throws IllegalStateException { | |
//get the main content part, this doesn't return the armor | |
String content = toBase64(playerInventory); |