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
require "gist.8deed890e0d92ef19506e889819b2e97.sample" | |
require "gist.835077aed5123947fe006e6d5ed5582b.books" | |
function spawnpoint(pos) | |
if pos == nil then | |
move(UP) | |
pos = vec3(getWorldPos()) | |
end | |
local eventqueue = events.register(PLAYER_JOINED) | |
for event in eventqueue.next do |
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
require "gist.8deed890e0d92ef19506e889819b2e97.sample" | |
function startup() | |
cmd("gamerule sendCommandFeedback false") | |
cmd("gamerule commandBlockOutput false") | |
--cmd('lua aura("@e[type=Player]")') | |
end |
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
require "gist.8deed890e0d92ef19506e889819b2e97.sample" | |
-- Wand of equal Trade | |
function woet() | |
print("Starting Wand of equal Trade 1") | |
click = events.register("RIGHT_CLICK", "LEFT_CLICK") | |
for event in click.next do | |
print("event",event.type,event.id) | |
if event.item ~= nil |
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
OPPOSITE = {NORTH=SOUTH,EAST=WEST,SOUTH=NORTH,WEST=EAST,UP=DOWN,DOWN=UP,LEFT=RIGHT,RIGHT=LEFT,FORWARD=BACK,BACK=FORWARD} | |
ROTATE90CW = {NORTH=EAST,EAST=SOUTH,SOUTH=WEST,WEST=NORTH} | |
ROTATE90CCW = {NORTH=WEST,WEST=SOUTH,SOUTH=EAST,EAST=NORTH} | |
particleOn=0 | |
function vec3(x,y,z) | |
return {x=x,y=y,z=z} | |
end |
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
local md5 = { | |
_VERSION = "md5.lua 1.1.0", | |
_DESCRIPTION = "MD5 computation in Lua (5.1-3, LuaJIT)", | |
_URL = "https://github.com/kikito/md5.lua", | |
_LICENSE = [[ | |
MIT LICENSE | |
Copyright (c) 2013 Enrique García Cota + Adam Baldwin + hanzao + Equi 4 Software | |
Permission is hereby granted, free of charge, to any person obtaining a |
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
local sha1 = { | |
_VERSION = "sha.lua 0.5.0", | |
_URL = "https://github.com/kikito/sha.lua", | |
_DESCRIPTION = [[ | |
SHA-1 secure hash computation, and HMAC-SHA1 signature computation in Lua (5.1) | |
Based on code originally by Jeffrey Friedl (http://regex.info/blog/lua/sha1) | |
And modified by Eike Decker - (http://cube3d.de/uploads/Main/sha1.txt) | |
]], | |
_LICENSE = [[ | |
MIT LICENSE |
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
require "gist.4d55b3573209200edcf73e1dbbd442ce.sample-lib" | |
BLOCK = { | |
hasName = function(exp) | |
return function(act) | |
return act.name == exp | |
end | |
end, | |
is = function(exp) | |
return function(act) |
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
function Vec3.crossProduct(v1,v2) | |
check.Vec3(v1,1) | |
check.Vec3(v2,2) | |
return Vec3.from( | |
v1.y*v2.z - v1.z*v2.y, | |
v1.z*v2.x - v1.x*v2.z, | |
v1.x*v2.y - v1.y*v2.x | |
) | |
end | |
-- ^ operator |
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
-- simple quaternion for doing vector rotations | |
-- ( https://gist.github.com/mkarneim/70b2ba363157c18266e20794db12b157 ) | |
--[[ | |
Original C Code from Phill Djonov, | |
http://vec3.ca/code/math/quaternions/ | |
]] | |
quat = {} |
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
-- Matrix | |
-- ( https://gist.github.com/mkarneim/99b9bd92612661ad47be403dc3c767ab ) | |
m3x3 = {} | |
function m3x3.mul( m, p) | |
local ret = vec3( | |
p.x * m[1][1] + p.y * m[2][1] + p.z * m[3][1], | |
p.x * m[1][2] + p.y * m[2][2] + p.z * m[3][2], | |
p.x * m[1][3] + p.y * m[2][3] + p.z * m[3][3] |
OlderNewer