This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4186435
commit f9adb26
Showing
7 changed files
with
142 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package krincraft.idk.JSON; | ||
|
||
public class decoder { | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package krincraft.idk.network; | ||
|
||
import org.apache.http.HttpEntity; | ||
import org.apache.http.ParseException; | ||
import org.apache.http.client.methods.CloseableHttpResponse; | ||
import org.apache.http.client.methods.HttpGet; | ||
import org.apache.http.impl.client.CloseableHttpClient; | ||
import org.apache.http.impl.client.HttpClients; | ||
import org.apache.http.util.EntityUtils; | ||
import org.bukkit.Bukkit; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
|
||
public class IDKnetHandler { | ||
private static final CloseableHttpClient httpclient = HttpClients.createDefault(); | ||
public static void get_projects() { | ||
String url = "https://api.modrinth.com/v2/search?"; | ||
String categories = "spigot"; | ||
String versions = Bukkit.getServer().getMinecraftVersion(); | ||
String arg = "facets=[[\"categories:"+categories+"\"],[\"versions:"+versions+"\"],[\"project_type:plugin\"]]"; | ||
try { | ||
URI uri = new URI(url+"limit=10&"+arg); | ||
} catch (URISyntaxException ignored) { | ||
} | ||
} | ||
|
||
public static String sendGet(String url) { | ||
HttpGet httpGet = new HttpGet(url); | ||
CloseableHttpResponse response = null; | ||
try { | ||
response = httpclient.execute(httpGet); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
String result = null; | ||
try { | ||
HttpEntity entity = response.getEntity(); | ||
if (entity != null) { | ||
result = EntityUtils.toString(entity); | ||
} | ||
} catch (ParseException | IOException e) { | ||
e.printStackTrace(); | ||
} finally { | ||
try { | ||
response.close(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
return result; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1 @@ | ||
config-version: 1 | ||
IDK_Helper_name: "IDK Help" | ||
IDK_Helper_lore: | ||
- "" | ||
IDK_Workbench_name: "IDK Workbench" | ||
IDK_Workbench_lore: | ||
- "" | ||
menu_title: "IDK Menu" | ||
workbench_title: "IDK Workbench" | ||
Information_name: "Information" | ||
Information_lore: | ||
- "Author: MinecraftBaymax" | ||
- "Add by IDK plugin." | ||
Help: | ||
- "IDK plugin help:" | ||
- "\n/IDK help - This help message" | ||
- "\n/IDK gm <number of gamemodes> - Change your gamemode" | ||
- "\n/IDK open workbench - Open a chest or a workbench" | ||
- "\n/IDK plugins - Check plugin list" | ||
- "\n/IDK load <plugin_name> - Load a plugin" | ||
- "\n/IDK disable <plugin_name> - Disable a plugin" | ||
- "\n/IDK enable <plugin_name> - Enable a plugin" | ||
- "\n/IDK menu - open IDK menu" | ||
- "\n/IDK ping - check your ping in game" | ||
- "\n/IDK reload - reload config file" |
This file contains 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