Skip to content

Commit

Permalink
Remove a few other modern methods that just weren't necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
2008Choco committed Feb 18, 2024
1 parent 29bc81f commit ff63018
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -335,18 +334,7 @@ else if (args[0].equalsIgnoreCase("givetool")) {
if (!player.getInventory().addItem(itemStack).isEmpty()) {
sender.sendMessage(ChatColor.RED + "Your inventory was too full and the tool could not be given to you!");
} else {
String message = "Successfully given the tool from category " + category.getId() + " and type " + itemStack.getType().getKey();

if (itemStack.hasItemMeta()) {
ItemMeta itemMeta = itemStack.getItemMeta();
assert itemMeta != null;

message += " and NBT " + itemMeta.getAsString() + ".";
} else {
message += ".";
}

sender.sendMessage(ChatColor.GREEN + message);
sender.sendMessage(ChatColor.GREEN + "Successfully given the tool from category " + category.getId() + " and type " + itemStack.getType().getKey() + ".");
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ public void apply(@NotNull VeinMinerPlugin plugin) {
rawCategoriesConfig.set(categoryId + "." + KEY_BLOCK_LIST, config.getStringList(KEY_BLOCK_LIST + "." + categoryId));
}

try {
/*
* setComments() was added in 1.18.1, but it's not big enough of a feature for me to bump past 1.17 support
* TODO: Remove try-catch when a version after 1.18 is required
*/
rawCategoriesConfig.setComments("Hand", List.of("Does not support an \"Items\" list, but does support all other options"));
rawCategoriesConfig.setComments("All", List.of(
"Does not support any configurable values other than \"BlockList\"",
"Applies this list of blocks to all other categories, to avoid repetition"
));
} catch (Exception | Error e) { /* ignore */ }

config.set(KEY_BLOCK_LIST, "Moved to categories.yml");
}

Expand Down

0 comments on commit ff63018

Please sign in to comment.