This file contains hidden or 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.Material; | |
| import org.bukkit.enchantments.Enchantment; | |
| import org.bukkit.inventory.ItemFlag; | |
| import org.bukkit.inventory.ItemStack; | |
| import org.bukkit.inventory.meta.EnchantmentStorageMeta; | |
| import org.bukkit.inventory.meta.ItemMeta; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; |
This file contains hidden or 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
| //to get main cuboid class: https://www.spigotmc.org/threads/region-cuboid.329859/ | |
| public static Cuboid convertCuboid(final List<Location> locations) { | |
| int firstPosX = Integer.MIN_VALUE; | |
| int firstPosY = Integer.MIN_VALUE; | |
| int firstPosZ = Integer.MIN_VALUE; | |
| int secondPosX = Integer.MAX_VALUE; | |
| int secondPosY = Integer.MAX_VALUE; |
This file contains hidden or 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 mc.obliviate.masterduels.utils.placeholder; | |
| public class InternalPlaceholder { | |
| private final String placeholder; | |
| private final String value; | |
| protected InternalPlaceholder(final String placeholder, final String value) { | |
| this.placeholder = placeholder; | |
| this.value = value; |
This file contains hidden or 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 mc.obliviate.test.textapi; | |
| import com.google.common.base.Preconditions; | |
| import mc.obliviate.test.Test; | |
| import org.bukkit.Bukkit; | |
| import org.bukkit.plugin.java.JavaPlugin; | |
| import java.util.UUID; | |
| import java.util.function.Consumer; |
This file contains hidden or 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 mc.obliviate.masterduels.utils; | |
| import mc.obliviate.masterduels.utils.placeholder.InternalPlaceholder; | |
| import mc.obliviate.masterduels.utils.placeholder.PlaceholderUtil; | |
| import org.bukkit.ChatColor; | |
| import org.bukkit.command.CommandSender; | |
| import org.bukkit.configuration.file.YamlConfiguration; | |
| import org.bukkit.entity.Player; | |
| import java.util.ArrayList; |
This file contains hidden or 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.Bukkit; | |
| import java.util.function.Function; | |
| public class ChainExecutor { | |
| private ChainTask first; | |
| private static Function<ChainTask, Boolean> toBooleanFunction(Runnable runnable) { | |
| return chain -> { |
This file contains hidden or 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 static Duration getRelativeDuration(Date date) { | |
| return Duration.ofMillis(Objects.requireNonNull(date).toInstant().toEpochMilli() - System.currentTimeMillis()); | |
| } | |
| public static String formatRelativeDuration(Duration duration, boolean verbose) { | |
| if (duration.isZero()) return "now"; | |
| String direction = duration.isNegative() ? "ago" : "later"; | |
| duration = duration.abs(); | |
| StringBuilder builder = new StringBuilder(); | |
| if (!applyTimeFormat(builder, duration.toDaysPart(), "day") || verbose) |
This file contains hidden or 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 ChatEntry implements Listener { | |
| private static final Map<UUID, ChatEntry> entryMap = new HashMap<>(); | |
| public Consumer<AsyncPlayerChatEvent> action; | |
| public ChatEntry(UUID uuid) { | |
| entryMap.put(uuid, this); | |
| Bukkit.getPluginManager().registerEvents(this, SeniorRegions.getInstance()); | |
| } |
This file contains hidden or 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
| int power(int n, int pow) { | |
| int res = n; | |
| if (pow == 0) return 1; | |
| while (--pow > 0) res *= n; | |
| return res; | |
| } | |
| // increases 'pow' until find the smallest power of 10 | |
| // which is bigger than the number. and its gives the digit count. | |
| int count_digits(int nbr) { |
This file contains hidden or 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
| #include <stdlib.h> | |
| #include <printf.h> | |
| int is_seperator(char c) { | |
| return (c == '\0' || c == ' ' || c == '\n'); | |
| } | |
| int word_length(char *str) { | |
| int i; |
OlderNewer