Skip to content

Instantly share code, notes, and snippets.

@dluechoy
dluechoy / README.md
Last active February 28, 2017 11:16
Defined Blocks for MCEdit2 `2.0.0 alpha-1050`

#defined_blocks.json

###for MCEdit 2.0.0 Alpha 1050

http://www.mcedit.net/

This is open invitation for completion and enhancement.

This is an incomplete and imperfect representation of he blocks within the scope of Agrarian Skies 2.

@dluechoy
dluechoy / MuPillars.cs
Last active August 29, 2015 14:21 — forked from thatfool/NoPillars.cs
Expansion on NoPillars.
/**
Forked from
https://gist.github.com/thatfool/8b8f90baaa5f62ed6b9d
NoPillars.cs
NoPillars mod for Cities:Skylines
**/
using ICities;
using UnityEngine;
@dluechoy
dluechoy / command_block Beacon 1
Last active August 29, 2015 13:56
Minecraft command_block command that creates a level 4 beacon directly below the command block.
summon MinecartCommandBlock ~ ~1 ~ {Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:Slime,Size:-2,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:MinecartCommandBlock,Riding:{id:FallingSand,TileID:157,Time:1},Command:setblock ~-1 ~-4 ~-1 133},Command:setblock ~ ~-4 ~-1 133},Command:setblock ~1 ~-4 ~-1 133},Command:setblock ~-1 ~-4 ~ 133},Command:setblock ~ ~-4 ~ 133},Command:setblock ~1 ~-4 ~ 133}},Command:setblock ~-1 ~-4 ~1 133},Command:setblock ~ ~-4 ~1 133},Command:setblock ~1 ~-4 ~1 133},Command:setblock ~ ~-3 ~ 138},Command:setblock ~ ~-1 ~ 10 7 },}}
@dluechoy
dluechoy / line_exercpt.cpp
Created June 22, 2013 00:56
uh.... these will be malfunctional for now.
/ meow_vec2d - dummy class for lists, angles in radians.
struct cat_vec2d {
double magnitude; //magnitude, ρ rho
double angle; //azimuth, θ theta
//zenith, φ phi
cat_vec2d(double rho = 0.0d, double theta = 0.0d) : magnitude (rho), angle (theta) {}
cat_vec2d(const cat_vec2d &v) : magnitude (v.magnitude), angle (v.angle) {}
~cat_vec2d(){}
@dluechoy
dluechoy / appendtogame.cpp
Last active December 18, 2015 05:38
So many hard coded "Press 'X' to Y" messages, that are wrong if the default keymap is not used. Informed that append does not fill in the pointers, therefore %s's won't work.
// (Press X (or Y)|Try) to Z
std::string game::press_x(action_id act)
{
std::vector<char> keys = keys_bound_to( action_id(act) );
if (keys.empty()) {
return "Try";
} else {
std::string keyed="Press ";
for (int j = 0; j < keys.size(); j++) {
if (keys[j] == '\'' || keys[j] == '"'){
@dluechoy
dluechoy / regex
Created May 24, 2013 19:42
random regexes used with Cataclysim-DDA' save files.
CataclysimDDA 0.4 item upgrade.
([0-9]+) (power_armor_frame|mocassins|jumpsuit|armguard|peacoat|armguard_[^ ]+|tophat|backpack|bandana|blazer|boots|boots_[^ ]+|coat|coat_[^ ]+|dress|flip_flops|glasses|glasses_[^ ]+|gloves_[^ ]+|hat|hat_[^ ]+|heels|helmet|helmet_[^ ]+|hoodie|jacket|jacket_[^ ]+|jeans|kevlar|mask|mask_[^ ]+|mbag|mittens|pants|pants_[^ ]+|poncho|gloves|purse|rucksack|scarf|shorts|shorts_[^ ]+|skirt|sneakers|socks|socks_[^ ]+|suit|sunglasses|sweater|sweatshirt|tank_toptophat|trenchcoat|tshirt|vest|[^ ]+_armor|armor|[^ ]+_shirt|shirt|[^ ]+_shoes|shoes|beltrig|holster|necklace|tank_top|fanny|goggles|goggles_[^ ]+) -1 [\-0-9]+ [0-9]+
\1 \2 -1 -1 268435456
([0-9]+) (power_armor_frame|mocassins|jumpsuit|armguard|peacoat|armguard_[^ ]+|tophat|backpack|bandana|blazer|boots|boots_[^ ]+|coat|coat_[^ ]+|dress|flip_flops|glasses|glasses_[^ ]+|gloves_[^ ]+|hat|hat_[^ ]+|heels|helmet|helmet_[^ ]+|hoodie|jacket|jacket_[^ ]+|jeans|kevlar|mask|mask_[^ ]+|mbag|mittens|pants|pants_[^ ]+|poncho|gloves|purse|
@dluechoy
dluechoy / game_excerpts.cpp
Last active December 17, 2015 16:39
Full and failed solution to liquid handling problem. The total solution could not be tested and therefore was not part of the pull request.
//code below could not be tested with worn items since at this time they are not implemented.
void game::unload(char chInput)
{
item it = (u.inv.remove_item_by_letter(chInput)); // this is necessary to prevent re-selection of the same item later
if (!it.is_null())
{
unload(it);
u.i_add(it, this);
}
else
@dluechoy
dluechoy / fontRenderer 2012.08.24
Created August 24, 2012 21:44
Bugged out fontRenderer
package net.minecraft.src;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.text.Bidi;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import javax.imageio.ImageIO;
import org.lwjgl.opengl.GL11;