Skip to content

Instantly share code, notes, and snippets.

@RainWarrior
RainWarrior / NewCodeTest.java
Created December 17, 2019 22:16
Some data fixer example code
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;
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(); }
}
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));
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 January 27, 2022 10:35
Animation State Machine grammar
{
"parameters": { "name": <time_value>, ... },
"clips": { "name": <clip>, ... },
"states": [ "name", ... ],
"transitions": { "name_from": "name_to", ... },
"start_state": "name"
}
<time_value> ::=
<number> // result = number; Constant value.
{
"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"
{
"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"
{
"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 }] },
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'
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