Skip to content

Instantly share code, notes, and snippets.

View jwulf's full-sized avatar
:octocat:
Coding on Halmak

Josh Wulf jwulf

:octocat:
Coding on Halmak
View GitHub Profile
@jwulf
jwulf / cam_capture.ts
Created December 10, 2017 15:06
Record your movement in Minecraft using Magikcraft
/**
* Capture a video of your movement in Minecraft.
*/
const magik = magikcraft.io;
function cam_capture(seconds = "--help", fps = 20) {
if (seconds === "--help") {
magik.dixit("Usage: /cast cam_capture [secs]");
magik.dixit("Usage: /cast cam_capture [secs] [fps]");
return;
const magik = magikcraft.io;
function arrow() {
function shoot() {
const Arrow = Java.type("org.bukkit.entity.Arrow");
const p = magik.getSender();
p.launchProjectile(Arrow.class);
}
@jwulf
jwulf / iptables.rules
Created December 3, 2017 10:34
/etc/iptables.rules
# Generated by iptables-save v1.6.0 on Sun Dec 3 10:08:29 2017
*filter
:INPUT ACCEPT [42:7241]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [6:616]
-A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth0 -o wlan0 -j ACCEPT
COMMIT
# Completed on Sun Dec 3 10:08:29 2017
# Generated by iptables-save v1.6.0 on Sun Dec 3 10:08:29 2017
@jwulf
jwulf / border.js
Last active September 3, 2017 14:17
Minecraft Border mini-game for Magikcraft
/**
* Border Minecraft mini-game for Magikcraft
* www.magikcraft.io
* Author: Josh Wulf <[email protected]>
*
* This is a cool little mini-game where the world border
* shrinks, and you have to stay inside it to stay alive.
*
* Note: to play, you need to add magikcraft-lore-ui-bar to your package.json file,
* or run `/npm install magikcraft-lore-ui-bar` in Minecraft.
{
"name": "param_magikcraft_package_json",
"version": "0.0.4",
"description": "",
"dependencies": {
"mct1": "https://github.com/mc-t1/mct1.git#eat",
"magikcraft-minigame-platforms" : "",
"magikcraft-lore-do": "",
"magikcraft-lore-ui-bar": "https://github.com/jwulf/magikcraft-lore-ui-bar.git#feature/tc",
type TextComponent = any;
declare interface IMagikCraftAPI {
getMappedItem: () => string;
setMappedItem: (key: string, value: string) => void;
getSpellsList: (sender: BukkitPlayer, senderName: string) => string[];
}
declare const MagikCraftAPI: IMagikCraftAPI;
@jwulf
jwulf / redux.js
Created September 1, 2017 12:37
Nanoflux-fusion test for Magikcraft
const isNode = (eval(`typeof magikcraft == 'undefined'`))
const say = (isNode) ? console.log : magikcraft.io.dixit;
const _setTimeout = (isNode) ? setTimeout : magikcraft.io.setTimeout;
const NanoFlux = require('nanoflux-fusion');
function redux() {
const fusionStore = NanoFlux.getFusionStore();
function init() {
@jwulf
jwulf / runTests.js
Created September 1, 2017 12:36
Magikcraft API tests
const magik = magikcraft.io;
function runTests() {
let testCount, testRunning, asyncTest, currentTest, asyncTimeout;
const tests = [];
function runTest(){
if (testRunning || tests.length == 0) {
return;
@jwulf
jwulf / redux-light-example.js
Created August 21, 2017 13:35 — forked from vasanthk/redux-light-example.js
redux in 14 lines of code
const store = createStore((state = { counter: 0 }, action) => {
switch(action.type) {
case "INCREMENT":
return { counter: state.counter + 1 }
case "DECREMENT":
return { counter: state.counter - 1 }
default:
return state
}
})
// Type definitions for magikcraft.io 0.9
// Project: https://github.com/Magikcraft/magikcraft.io
// Definitions by: Josh Wulf <[email protected]>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
type TextComponent = any;
declare interface IMagikCraftAPI {
getMappedItem: () => string;