Copy the other file in this gist into your $GRADLE_USER_HOME/init.d
(usually this is:
~/.gradle/init.d/installMinecraft.init.gradle.kts
) and replace the installation path with the correct path.
From now on, every mod project that uses forgegradle or loom (and a roughly standard project layout) should have
the task ./gradlew installToMinecraft
available (also available in your IDE), which will install that jar.
in projects with multiple subprojects, you might want to use a fully qualified task path: Either
./gradlew :installToMinecraft
for installing the root project, or ./gradlew :forge-1.8.9:installToMinecraft
to install a subproject (for example for multi-version projects).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class EnumMap<E : Enum<E>, V : Any>( | |
meta: Class<E> | |
) : MutableMap<E, V> { | |
private val universe = meta.enumConstants | |
private val storage = Array.newInstance(java.lang.Object::class.java, universe.size) as kotlin.Array<V?> | |
override fun get(key: E): V? { | |
return storage[key.ordinal] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color | |
import java.awt.image.BufferedImage | |
import java.io.File | |
import javax.imageio.ImageIO | |
import kotlin.system.exitProcess | |
fun main(args: Array<String>) { | |
var inf: File? = null | |
var outf: File? = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.* | |
import com.google.gson.annotations.SerializedName | |
import com.google.gson.reflect.TypeToken | |
import com.google.gson.stream.JsonReader | |
import com.google.gson.stream.JsonToken | |
import com.google.gson.stream.JsonWriter | |
import kotlin.reflect.* | |
import kotlin.reflect.full.isSubtypeOf | |
import kotlin.reflect.full.memberProperties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Graphics2D | |
import java.awt.image.BufferedImage | |
import java.io.File | |
import java.util.* | |
import javax.imageio.ImageIO | |
/** | |
* Copyright 2022 Linnea Gräf | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Replace imgur links in the Abishirt vote with images | |
// @version 1 | |
// @grant none | |
// @run-at document-end | |
// @include https://civs.cs.cornell.edu/cgi-bin/* | |
// ==/UserScript== | |
console.log("Replacing imgur links with embeded images"); | |
function mutate(el){ | |
el.innerHTML = el.innerHTML.replace(/https:\/\/imgur\.com\/([a-z0-9]+)/i, "<img src=\"https://i.imgur.com/$1.png\" height=200/>https://imgur.com/$1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Closeable | |
import java.util.* | |
class ResourceContext { | |
private val toClose = mutableListOf<Closeable>() | |
fun <A : Closeable> open(thing: A): A { | |
toClose.add(thing) | |
return thing | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Futter { | |
String name; | |
float mass; | |
public Futter(String name) { | |
this.name = name; | |
this.mass = 100f; | |
} | |
public String toString(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from discord import Embed, Color, Message, Member, Reaction | |
from discord.ext.commands import Bot, Context as CommandContext, command, group, Group, has_permissions | |
YES_REACTION = "\U00002705" | |
NO_REACTION = "\U0000274c" | |
async def create_action_poll(ctx: CommandContext, description, callback): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <limits.h> | |
#define MAX_NUM_LEN 12 | |
#define HOTSTREAK 3 | |
#define MAX_WINS 16 |
NewerOlder