Skip to content

Commit

Permalink
Use non-deprecated CyberAPI methods
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberedCake committed Jun 20, 2024
1 parent 3a1cea0 commit 4b3fc13
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected CyberAPI startCyberAPI(@Nullable Settings settings) {

log = new APILog(); // for private use only

if (settings == null) settings = Settings.builder().build();
if (settings == null) settings = Settings.builder().build("");
this.settings = settings;
log.verbose("Starting CyberAPI...");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected CyberAPI startCyberAPI(@Nullable Settings settings) {

log = new APILog(); // for private use only

if (settings == null) settings = Settings.builder().build(); // use default values
if (settings == null) settings = Settings.builder().build(""); // use default values
this.settings = settings;
log.verbose("Starting CyberAPI...");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public GUISlots(@NotNull Player player, @IntRange(from = 1, to = 6) int rows, @N
final Material originalMaterial = originalItem.getType();
ItemMeta meta = originalItem.getItemMeta();
if (meta == null) Bukkit.getItemFactory().getItemMeta(originalMaterial);
final String originalName = (Objects.requireNonNull(meta).hasDisplayName() ? meta.getDisplayName() : meta.getLocalizedName());
final String originalName = (Objects.requireNonNull(meta).hasDisplayName() ? meta.getDisplayName() : meta.getItemName());
CustomGUI gui = this;
this.task = new BukkitRunnable() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public void init(String path) {
try {
long mss = System.currentTimeMillis();
for(Class<?> clazz : CyberAPI.getInstance().getPluginClasses()) {
if (!(Validators.isSubtype(clazz, SpigotCommand.class)) && !(Validators.isSubtype(clazz, Command.class))) continue;
if (!(Validators.isSubtype(clazz, SpigotCommand.class))) continue;

SpigotCommand command = (SpigotCommand) clazz.getDeclaredConstructors()[0].newInstance();
try {
for(CommandInformation information : command.getCommands()) {
Expand Down

0 comments on commit 4b3fc13

Please sign in to comment.