mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-29 13:05:44 +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;
|
PluginCommand command = null;
|
||||||
try {
|
try {
|
||||||
Constructor<?> constructor = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
|
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());
|
command = (PluginCommand) constructor.newInstance(label, discordSRV.plugin());
|
||||||
discordSRV.server().getCommandMap().register(label, discordSRV.plugin().getName().toLowerCase(Locale.ROOT), command);
|
discordSRV.server().getCommandMap().register(label, discordSRV.plugin().getName().toLowerCase(Locale.ROOT), command);
|
||||||
} catch (ReflectiveOperationException ignored) {}
|
} catch (ReflectiveOperationException ignored) {}
|
||||||
|
@ -52,7 +52,7 @@ public class BinPasteService implements PasteService {
|
|||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(binUrl + "/v1/post")
|
.url(binUrl + "/v1/post")
|
||||||
.post(RequestBody.create(MediaType.get("application/json"), json.toString()))
|
.post(RequestBody.create(json.toString(), MediaType.get("application/json")))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try (Response response = discordSRV.httpClient().newCall(request).execute()) {
|
try (Response response = discordSRV.httpClient().newCall(request).execute()) {
|
||||||
|
@ -39,7 +39,7 @@ public class BytebinPasteService implements PasteService {
|
|||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(bytebinUrl + "/post")
|
.url(bytebinUrl + "/post")
|
||||||
.header("Content-Encoding", "gzip")
|
.header("Content-Encoding", "gzip")
|
||||||
.post(RequestBody.create(MediaType.get("application/octet-stream"), fileContent))
|
.post(RequestBody.create(fileContent, MediaType.get("application/octet-stream")))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try (Response response = discordSRV.httpClient().newCall(request).execute()) {
|
try (Response response = discordSRV.httpClient().newCall(request).execute()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user