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
package me.koalaoncaffeine.itemstack; | |
import org.bukkit.ChatColor; | |
import org.bukkit.Material; | |
import org.bukkit.enchantments.Enchantment; | |
import org.bukkit.inventory.ItemFlag; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.inventory.meta.ItemMeta; | |
import org.bukkit.material.MaterialData; |
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
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public final class TimeParser { | |
private static final long MINUTE = 60; | |
private static final long HOUR = MINUTE * 60; | |
private static final long DAY = HOUR * 24; | |
private static final long WEEK = DAY * 7; |
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
import org.bukkit.configuration.file.FileConfiguration; | |
import org.bukkit.configuration.file.YamlConfiguration; | |
import java.io.File; | |
import java.nio.file.Path; | |
public class FileHandler { | |
private FileConfiguration config = new YamlConfiguration(); | |
private File 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
public final class CustomCommandPlugin extends JavaPlugin { | |
@Override | |
public final void onEnable() { | |
getCommand("command").setExecutor(new CommandClass(getConfig().getString("Hello-Message"))); | |
// creating a new instance of the command class, passing in the hello message parameter as the String from the command class' constructor. | |
// getCommand being an inherited method from JavaPlugin. | |
// setExecutor being a method which every PluginCommand has, defining where it will run to. | |
// new CommandClass being the constructor of the class below. | |
// getConfig().getString("Hello-Message"); being a String located in the config, if this string is not there: |