mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-25 12:25:15 +01:00
Resolve a few deprecations
This commit is contained in:
parent
7c8ff0d57b
commit
e82f03cd21
@ -79,9 +79,7 @@ public abstract class AbstractBukkitCommandHandler implements ICommandHandler {
|
||||
PluginCommand command = null;
|
||||
try {
|
||||
Constructor<?> constructor = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
|
||||
if (!constructor.isAccessible()) {
|
||||
constructor.setAccessible(true);
|
||||
}
|
||||
constructor.setAccessible(true);
|
||||
command = (PluginCommand) constructor.newInstance(label, discordSRV.plugin());
|
||||
discordSRV.server().getCommandMap().register(label, discordSRV.plugin().getName().toLowerCase(Locale.ROOT), command);
|
||||
} catch (ReflectiveOperationException ignored) {}
|
||||
|
@ -52,7 +52,7 @@ public class BinPasteService implements PasteService {
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(binUrl + "/v1/post")
|
||||
.post(RequestBody.create(MediaType.get("application/json"), json.toString()))
|
||||
.post(RequestBody.create(json.toString(), MediaType.get("application/json")))
|
||||
.build();
|
||||
|
||||
try (Response response = discordSRV.httpClient().newCall(request).execute()) {
|
||||
|
@ -39,7 +39,7 @@ public class BytebinPasteService implements PasteService {
|
||||
Request request = new Request.Builder()
|
||||
.url(bytebinUrl + "/post")
|
||||
.header("Content-Encoding", "gzip")
|
||||
.post(RequestBody.create(MediaType.get("application/octet-stream"), fileContent))
|
||||
.post(RequestBody.create(fileContent, MediaType.get("application/octet-stream")))
|
||||
.build();
|
||||
|
||||
try (Response response = discordSRV.httpClient().newCall(request).execute()) {
|
||||
|
Loading…
Reference in New Issue
Block a user