Skip to content

Instantly share code, notes, and snippets.

Draco18s / IEventType.cs
Created May 30, 2020
A delegate based C# event messaging system.
View IEventType.cs
namespace draco18s.EventSystem {
/// <summary>
/// Base interface for all event types
/// </summary>
public interface IEventType {
/// <summary>
/// TODO - This method signature will change depending on implementation details
/// </summary>
/// <returns></returns>
object Serialize(); //whatever this means for your project
View Rocket equasions
///Spend fuel and accelerate in direction
private void Thrust(Vector3 dir, float draw, float seconds) {
float change = GetVelocityFromBurn(this, draw * seconds);
velocity += change*dir;
///Determine the number of seconds in order to reach velocity (assuming no friction)
public static float CalculateBurnTimeToReachVelocity(Spaceship ship, float vel, float draw) {
View Gold Hunter (with bots)
//Copy and paste bot functions here:
function justFarm(me, others){
return farm();
function undyableBot(me, others, storage){
if(me.hp < 100 - (me.levels.heal + 5)*2){
return heal()
Draco18s / GuiMultiLineTextField
Last active Jul 20, 2020
A multiline text entry box for Minecraft's GUI system
View GuiMultiLineTextField
package com.draco18s.runic.client.gui;
import java.util.ArrayList;
import org.lwjgl.input.Mouse;
import net.minecraft.client.Minecraft;
View UI_ShaderFixes
Shader "Unlit/UI_ShaderFixes" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Color("Color Multiplier", Color) = (1, 1, 1, 1) // color
_Cutoff ("Cutoff", Range(0,1)) = 0.5
[HideInInspector]_StencilComp("Stencil Comparison", Float) = 8
[HideInInspector]_Stencil("Stencil ID", Float) = 1
[HideInInspector]_StencilOp("Stencil Operation", Float) = 0
[HideInInspector]_StencilWriteMask("Stencil Write Mask", Float) = 255
Draco18s / mc log
Created Jun 11, 2018
some crash log
View mc log
2018-06-10 14:10:06,452 main WARN Disabling terminal, you're running in an unsupported environment.
[14:10:06] [main/INFO] [GradleStart]: Extra: []
[14:10:06] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Gamer/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[14:10:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[14:10:06] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[14:10:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[14:10:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[14:10:06] [main/INFO] [FML]: Forge Mod Loader version for Min
View Advancements
public static void setupDir(Configuration config) {
RECIPE_DIR = null;
if (RECIPE_DIR == null) {
RECIPE_DIR = config.getConfigFile().toPath().resolve("../recipes/").toFile();
ADVANCE_DIR = config.getConfigFile().toPath().resolve("../advancements/").toFile();
String dir = config.getConfigFile().toPath().resolve("../recipes/").toString();
String pattern = "config\\\\(.*)\\.cfg\\\\\\.\\.\\\\recipes";
Pattern p = Pattern.compile(pattern);
Matcher matcher = p.matcher(dir);
View Frustum Checking
public static class GameObjectExtensions {
public static bool IsVisibleFrom(this GameObject obj, Camera camera) {
Bounds b = obj.GetComponent<Collider>().bounds;
Plane[] planes = GeometryUtility.CalculateFrustumPlanes(camera);
return GeometryUtility.TestPlanesAABB(planes, b);
public static bool IsVisibleFrom(this GameObject obj, Plane[] planes) {
Bounds b = obj.GetComponent<Collider>().bounds;
Draco18s / BlockUnstableStone
Created Dec 17, 2014
Gravity effected and distance-support Stone Replacement
View BlockUnstableStone
package com.draco18s.hazards.block;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.draco18s.hardlib.HashUtils;
import com.draco18s.hazards.StoneRegistry;
import com.draco18s.hazards.block.helper.UnstableStoneHelper;
View MinecraftOres.xml
<!--************************ CustomOreGen Minecraft Ores Module ****************
:set ai et ts=4 sw=4
* This file contains Presets, Options, and Distributions for the 7
* vanilla minecraft ores:
* Coal, Iron, Gold, Redstone, Diamond, Lapis Lazuli, and Emerald.
You can’t perform that action at this time.