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.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 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 net.md_5.bungee.api.ChatColor; | |
import java.awt.*; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public class Gradient { | |
List<String> gradient; |
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 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 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 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
private int getSnakeSlot(int slot) { | |
final int horizontalLength = 2; | |
final int verticalLength = 5; | |
final int patternLength = 2 * (horizontalLength + verticalLength); | |
final int patternNo = slot / (patternLength + 1); // 10 -> 1, 8/10 -> 1, 12/10 -> 2 | |
int slotNoInPattern = slot % (patternLength + 1); // 8/10 -> 8, 12/10 -> 2 | |
final boolean isInReversedPattern = slotNoInPattern > patternLength / 2; |
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 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 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 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 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 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()); | |
} |
OlderNewer