Skip to content

Instantly share code, notes, and snippets.

@Braayy
Braayy / SvgIcon.kt
Created October 15, 2021 17:15
A simple way to inject inline svg files at runtime on Compose For Web
import kotlinx.browser.document
import kotlinx.browser.window
import org.jetbrains.compose.web.attributes.AttrsBuilder
import org.w3c.dom.*
import org.w3c.dom.svg.SVGElement
import kotlin.js.Date
enum class SvgIcon(val path: String) {
// Icons goes here
}
@Braayy
Braayy / NBTTag.java
Created November 20, 2020 22:12
Simple NBTTagCompound Wrapper
package braayy.lib.util;
import org.bukkit.inventory.ItemStack;
import java.lang.reflect.Method;
@SuppressWarnings("ConstantConditions")
public class NBTTag {
private static Class<?> NBT_TAG_COMPOUND_CLASS;
@Braayy
Braayy / DefaultMessageProvider.java
Last active November 5, 2020 19:12
A message provider with i18n for the bukkit plataform
package braayy.lib.provider.impl;
import braayy.lib.provider.MessageProvider;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
@Braayy
Braayy / SimpleScoreboard.java
Created April 14, 2020 04:07
A simple and lightweight but powerful one class scoreboard lib
package braayy.simplescoreboard;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.List;