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 static java.lang.Math.*; | |
double[][] intersections(double[] p, double[] o, double[] d, double r) { | |
double[] ip = inverse(p); | |
double a = dot(d, d); | |
double b = 2 * dot(o, d) + 2 * dot(ip, d); | |
double c = dot(o, o) + 2 * dot(ip, o) + dot(ip, ip) - pow(r, 2); | |
double dct = pow(b, 2) - 4 * a * c; |
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.kyori.adventure.text.Component; | |
import net.kyori.adventure.text.TextComponent; | |
import net.kyori.adventure.text.TextReplacementConfig; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.regex.MatchResult; |
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 class Buffers<T> { | |
private T previous = null, current; | |
public Buffers(T def) { | |
this.current = def; | |
this.previous = def; | |
} | |
public void swap() { | |
T temp = current; | |
current = previous; |
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
option NMS: | |
get: | |
return 4th element out of ((class "org.bukkit.Bukkit").getServer().getClass().getPackage().getName() split at ".") # Yay NMS version! | |
import: | |
net.minecraft.server.{@NMS}.MojangsonParser # Used for String -> NBTTagCompound conversion | |
net.minecraft.server.{@NMS}.ItemStack as NMSItemStack # Used to generate an NMS ItemStack from an NBTTagCompound with the NMSItemStack#a(NBTTagCompound) method | |
plural expression serialized %itemtypes%: | |
return type: strings | |
get: | |
loop exprs-1: |
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
command /kit [<text>]: | |
permission: kits.kit | |
trigger: | |
if arg-1 isn't set: | |
send "&6Kits: &e%all indices of {kitsystem.kits::*}%" | |
stop | |
set {_i::*} to all indices of {kitsystem.kits::*} | |
if {_i::*} doesn't contain uncoloured arg-1: | |
send "&cThat kit doesn't exist!" |