Skip to content

Instantly share code, notes, and snippets.

View efekos's full-sized avatar

efekos efekos

View GitHub Profile
@efekos
efekos / CachedFunction.java
Created September 19, 2024 21:11
A small class to cache the result of a function.
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
public class CachedFunction<T, R> {
private final Function<T, R> func;
private final Map<Integer, R> cache = new HashMap<>();
@efekos
efekos / BaseComponent.java
Last active August 2, 2024 11:43
Giant BaseComponent builder to help you build large components
package PACKAGE.NAME.HERE;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.*;
import net.md_5.bungee.api.chat.hover.content.Content;
import net.md_5.bungee.api.chat.hover.content.Entity;
import net.md_5.bungee.api.chat.hover.content.Item;
import net.md_5.bungee.api.chat.hover.content.Text;
import java.util.ArrayList;
@efekos
efekos / css_color_names.json
Created February 7, 2024 18:03
Every availabe CSS color name for validation checks or enums
[
"aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet",
"brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan",
"darkblue", "darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen",
"darkorange","darkred", "darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise",
"darkviolet","deeppink","deepskyblue", "dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen",
"fuchsia","gainsboro","ghostwhite","gold","goldenrod", "gray","grey","green","greenyellow","honeydew","hotpink",
"indianred","indigo","ivory","khaki","lavender","lavenderblush", "lawngreen","lemonchiffon","lightblue","lightcoral",
"lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen", "lightpink","lightsalmon","lightseagreen",
"lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow",
@efekos
efekos / note_block_state_1_20.json
Last active January 24, 2024 22:57
Full blockstate file of Minecraft note block. Compatible for 1.20.X
{
"variants": {
"instrument=banjo,note=0,powered=true": {
"model": "minecraft:block/note_block"
},
"instrument=banjo,note=0,powered=false": {
"model": "minecraft:block/note_block"
},
"instrument=banjo,note=1,powered=true": {
"model": "minecraft:block/note_block"