Skip to content

Instantly share code, notes, and snippets.

Avatar

tterrag tterrag1098

View GitHub Profile
View PrettifyMessageCreate.java
public class PrettifyMessageCreate extends MessageConverter {
public static DiscordClient client;
private static Cache<Long, String> channelNames = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.HOURS).build();
public String convert(ILoggingEvent event) {
if (event.getLoggerName().startsWith("discord4j.gateway.inbound.0")) {
for (Object param : event.getArgumentArray()) {
if (param instanceof GatewayPayload) {
GatewayPayload<?> payload = (GatewayPayload) param;
View NoClassloadClassWriter.java
package com.enderio.core.common.transform;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.IOUtils;
View Hw4.java
import java.util.Scanner;
import java.util.Random;
public class Hw4 {
public static final int BOARD_SIZE = 10;
enum space {Empty,Player,Walked_Path,Goal,Mines};//eumeration creates a type
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int pX = 0;//players x and y
View Lang2Json.java
package chisel.scripts;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
@tterrag1098
tterrag1098 / changes.diff
Created Dec 4, 2017
Better proxy prototype
View changes.diff
Author:
Committer:
Parent: 74d08d66f9fcfb267b4fc6b38b62c3fd0317847c (Merge branch '1.12.x' of https://github.com/MinecraftForge/MinecraftForge into emissive_items)
Branch:
Follows:
Precedes:
Local uncommitted changes, not checked in to index
-------- src/main/java/net/minecraftforge/fml/common/ProxyInjector.java --------
View RenderModelNew.java
private void renderModel(IBakedModel model, int color, ItemStack stack)
{
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
List<BakedQuad> allquads = new ArrayList<>();
for (EnumFacing enumfacing : EnumFacing.values())
{
allquads.addAll(model.getQuads((IBlockState)null, enumfacing, 0L));
View andesite.json
{
"forge_marker": 1,
"defaults": {"model":"cube_all"},
"variants": {
"indent": [{"textures":{"all":"chisel:blocks/andesite/indent"}}],
"bricks-small": [{"textures":{"all":"chisel:blocks/andesite/bricks-small"}}],
"bricks-soft": [{"textures":{"all":"chisel:blocks/andesite/bricks-soft"}}],
"tiles-small": [{"textures":{"all":"chisel:blocks/andesite/tiles-small"}}],
"bricks-encased": [{"textures":{"all":"chisel:blocks/andesite/bricks-encased"}}],
"cracked": [{"textures":{"all":"chisel:blocks/andesite/cracked"}}],
View start.sh
#!/bin/bash
# Terminate running screen, if it exists
if screen -list | grep -q "botscreen"; then
echo "Terminating current bot instance"
screen -S botscreen -p 0 -X stuff "stop^M"
else
echo "No current bot instance found"
fi