Skip to content

Instantly share code, notes, and snippets.

View vznxyz's full-sized avatar
💎
🤫 😄

vznxyz

💎
🤫 😄
View GitHub Profile
@MrBlobman
MrBlobman / Sounds.java
Last active June 24, 2021 21:07
A pre 1.9 to post 1.9 spigot sound enum mapping to use sound names across both versions.
// The following license should allow reuse, redistribution, with or without edits and with or without attribution.
// Do what you want with it!
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 MrBlobman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@Cybermaxke
Cybermaxke / InventoryTitleHelper
Last active October 13, 2023 09:38
[CraftBukkit/Spigot] Send a new title of the currently opened inventory.
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import static com.google.common.base.Preconditions.checkNotNull;
@aadnk
aadnk / AABB.java
Created October 23, 2013 18:25
A simple AABB intersection algorithm for Bukkit. Returns the intersection point as well.
/**
* Represents an axix-aligned bounding box.
*
* @author Kristian
*/
public class AABB {
public static class Vec3D {
/**
* Point with the coordinate (1, 1, 1).
*/