This file contains hidden or 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
//Imports | |
//Aliases | |
var PlayerChatEvent = org.bukkit.event.player.PlayerChatEvent; | |
//Event listener | |
function onPlayerChat (evt) { | |
//Get the message | |
var msg = evt.getMessage(); |
This file contains hidden or 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
//Imports | |
//Aliases | |
var PlayerInteractEvent = org.bukkit.event.player.PlayerInteractEvent; | |
var Material = org.bukkit.Material; | |
//List of concrete colors | |
var concreteColors = [ | |
Material.BLACK_CONCRETE, |
This file contains hidden or 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
/**Get char from world coordinates | |
* @param {Integer} x world coordinate | |
* @param {Integer} y world coordinate | |
*/ | |
let getCharFromXY = (x, y)=> { | |
return getChar( | |
Math.floor(x / 16), | |
Math.floor(y / 8), | |
x - Math.floor(x / 16) * 16, | |
y - Math.floor(y / 8) * 8 |
This file contains hidden or 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
let pi = 3.141592653589793; //All the digits I could remember.. | |
let radians = (degrees) => degrees * (pi / 180); | |
let degrees = (radians) => radians * (180 / pi); | |
let lerp = (a, b, c) => a + c * (b - a); | |
let dist = (x1, y1, x2, y2) => Math.sqrt( | |
Math.pow(x1 - x2, 2) + | |
Math.pow(y1 - y2, 2) | |
); |
This file contains hidden or 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
var ctrlIsDown = false; | |
var fillChar = "▓"; | |
var points = [{x:undefined,y:undefined},{x:undefined,y:undefined}]; | |
var lastPointModified = false; //false = 1, true = 2 | |
var cursorCoordsGlobal = {x:0,y:0}; | |
function onClick (evt) { | |
if (evt.button != 0) return; |
This file contains hidden or 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
/* Built using Matthew Sachin's documentation as reference | |
* https://github.com/MathewSachin/NIco/wiki/Ico,-Cur-and-PE-Formats | |
* See example function 'test' | |
* | |
* Abilities: | |
* Read a cursor or icon file and get it's image data (raw) | |
* | |
* Future plans: | |
* Read and then parse into different data sets for convenience like: | |
* 1d arrays of hex/web colors, or int colors |
NewerOlder