Skip to content

Instantly share code, notes, and snippets.

@RainWarrior
RainWarrior / NewCodeTest.java
Created Dec 17, 2019
Some data fixer example code
View NewCodeTest.java
package net.minecraft.util.datafix;
import com.google.gson.JsonElement;
import com.google.gson.internal.Streams;
import com.google.gson.stream.JsonReader;
import com.mojang.datafixers.DSL;
import com.mojang.datafixers.DataFix;
import com.mojang.datafixers.Dynamic;
import com.mojang.datafixers.OpticFinder;
import com.mojang.datafixers.RewriteResult;
View stuff.java
abstract class TestA<T extends TestA<T>> {}
abstract class TestB<T extends TestB<T>> extends TestA<T> {}
final class TestBF extends TestB<TestBF>
{
static TestBF create() { return new TestBF(); }
}
View java.java
private class T extends ClassLoader {
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException
{
ClassNode node = readClassNode(name);
// better actual set of default composable contexts
for (MethodNode m: node.methods) {
// set in the list, you know what I mean
m = transform(new WholeMethodContext(m));
View chest.ogex
Metric (key = "distance") {float {1.0}}
Metric (key = "angle") {float {1.0}}
Metric (key = "time") {float {1.0}}
Metric (key = "up") {string {"z"}}
Node $node1
{
Name {string {"Armature"}}
Transform %transform
@RainWarrior
RainWarrior / grammar.js
Last active Jan 27, 2022
Animation State Machine grammar
View grammar.js
{
"parameters": { "name": <time_value>, ... },
"clips": { "name": <clip>, ... },
"states": [ "name", ... ],
"transitions": { "name_from": "name_to", ... },
"start_state": "name"
}
<time_value> ::=
<number> // result = number; Constant value.
View modular_storage.json
{
"forge_marker": 1,
"defaults": {
"model": "forge:multi-layer",
"custom": {
"base": "rftools:modular_storage_aux#main",
"Solid": "rftools:modular_storage_aux#main",
"Cutout": "rftools:modular_storage_aux#overlay"
},
"transform": "forge:default-block"
View breaking_block.json
{
"forge_marker": 1,
"defaults": {
"model": "forge:multi-layer",
"custom": {
"base": "yourmod:breaking_block#base",
"Solid": "yourmod:breaking_block#base",
"Translucent": "yourmod:breaking_block#breaking"
},
"transform": "forge:default-block"
View thaumometer.json
{
"forge_marker": 1,
"defaults": {
"model": "forgedebugmodelloaderregistry:scanner.obj",
"custom": { "flip-v": true }
},
"variants": {
"inventory": [{
"transform": {
"firstperson": { "translation": [-0.33, 0.9, -0.33], "rotation": [{ "y": -45 }, { "x": 90 }, { "y": 90 }] },
View build.grable
testCompile 'commons-logging:commons-logging:1.1.3'
// testCompile 'com.mojang:realms:1.7.9'
// testCompile 'com.mojang:authlib:1.5.21'
testCompile 'com.google.guava:guava:17.0'
testCompile 'com.google.code.gson:gson:2.2.4'
// testCompile 'com.ibm.icu:icu4j-core-mojang:51.2'
// testCompile 'com.paulscode:codecwav:20101023'
// testCompile 'com.paulscode:librarylwjglopenal:20100824'
// testCompile 'com.paulscode:soundsystem:20120107'
// testCompile 'com.paulscode:libraryjavasound:20101123'
View signatures
Test: test testJar(org.jetbrains.java.decompiler.MinecraftDecompilationTest) produced standard out/err: WARN: Invalid signature: Lcom/google/common/cache/LocalCache<TK;TV;>.AbstractCacheSet<Ljava/util/Map$Entry<TK;TV;>;>;
Test: test testJar(org.jetbrains.java.decompiler.MinecraftDecompilationTest) produced standard out/err: WARN: Invalid signature: Lcom/google/common/cache/LocalCache<TK;TV;>.WriteThroughEntry;
Test: test testJar(org.jetbrains.java.decompiler.MinecraftDecompilationTest) produced standard out/err: WARN: Invalid signature: Lcom/google/common/cache/LocalCache<TK;TV;>.WriteThroughEntry;
Test: test testJar(org.jetbrains.java.decompiler.MinecraftDecompilationTest) produced standard out/err: WARN: Invalid signature: ()Lcom/google/common/cache/LocalCache<TK;TV;>.WriteThroughEntry;
Test: test testJar(org.jetbrains.java.decompiler.MinecraftDecompilationTest) produced standard out/err: WARN: Invalid signature: Lcom/google/common/cache/LocalCache<TK;TV;>.HashIterator<TK;>;
Test: test testJar(org.jetb