Skip to content

Instantly share code, notes, and snippets.

package ca.deamon.dungeon;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class MazeGen {
int w, h;
byte[] region;
@Deamon5550
Deamon5550 / gist:10485812
Last active August 29, 2015 13:59
Hello World
import java.util.Random;
public class Main {
public static void main(String[] args) {
Random rand = new Random(-229985452);
StringBuilder sb = new StringBuilder();
int k=1;
for (;;)
{
k = rand.nextInt(27);
standest
ealenosoretha
ono
poneabered
hededainstaty
tytofatwnox
sereamshamal
ales
plitheullere
wilytchwiedo
+++++ +++++ +++++ +++++ +++++ + number of inputs
>
>+++++ ++++
[
<+++++ +++++
>-
]
<+++++ ++ set array(1) to 97 to shift letters to be 0 based
<
@Deamon5550
Deamon5550 / gist:f66db1a5772c1b23d586
Created July 9, 2014 02:07
String to binary converter
++++++++++++++++++++
++++++>>+++++++++[<+
+++++++++>-]<+++++++
>>>>>>>>>>>+++++++++
+++++++>++++++++>+++
+>++>+>>>++++[<<++++
++++++>++++++++++>-]
<+++++<++<<<<<<<<<<<
<<<<<<[>>>>,<[-]<[-]
<[->+>+<<]>[-<+>]>[-
@Deamon5550
Deamon5550 / gist:ebb4ff6c67742de53aa1
Created July 21, 2014 22:45
TileEntity serialization/deserialization
package com.thevoxelbox.voxelsniper.util.schematic;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.Note;
import org.bukkit.SkullType;
@Deamon5550
Deamon5550 / gist:c14a43ed9e279e94ac7e
Last active August 29, 2015 14:04
Stencil Rework
Stencil Brush:
Notes:
-If you have better names for the types, that would be great
-The type is the selection method, which all fall into one of 4 shapes (cuboid, ellipsoid, ellipse_extruded, and poly_2d)
-The _d suffix on selections is to denote that it is defined based on additional clicks and not brush settings (set, ellipse, ellipsoid
and poly_2d are defined by default)
Commands:
@Deamon5550
Deamon5550 / gist:b54f1e532fe2dcf01881
Created July 23, 2014 17:26
Stencil List Rework
Stencil List rework:
Notes:
Commands:
/b sl (full|fill|replace|list) [name] (-rotate|r (#)) (-flip|f (NSEWUD)) (+|-[stencil_name])...
Same command as before but with added arguements on the end to modify the stencil lists or create new ones in-game
the list arguement will print out the currently included stencils in the specified (or your current) stencil list
package com.thevoxelbox.voxelsniper.util;
public class Rot3d
{
double[][] r = new double[3][3];
public Rot3d(double u, double v, double w)
{
double cos1 = Math.cos(u);
double sin1 = Math.sin(u);
summon FallingSand ~ ~2 ~2 {Time:1,Block:minecraft:redstone_block,Riding:{
id:FallingSand,Time:1,Block:minecraft:command_block,TileEntityData:{Command:fill ~ ~1 ~ ~ ~-9 ~ air},Riding:{
id:FallingSand,Time:1,Block:minecraft:command_block,TileEntityData:{Command:
summon FallingSand ~-2 ~-6 ~ {Time:1,Block:minecraft:redstone_block,Riding:{
id:FallingSand,Time:1,Block:minecraft:command_block,TileEntityData:{Command:say 12},Riding:{
id:FallingSand,Time:1,Block:minecraft:command_block,TileEntityData:{Command:say 11},Riding:{
id:FallingSand,Time:1,Block:minecraft:redstone_block,Riding:{
id:FallingSand,Time:1,Block:minecraft:command_block,TileEntityData:{Command:say 10},Riding:{
id:FallingSand,Time:1,Block:minecraft:command_block,TileEntityData:{Command:say 9},Riding:{