Skip to content

Instantly share code, notes, and snippets.

View Matthewacon's full-sized avatar
🔥
"everything is a type if you're brave enough"

Matthewacon Matthewacon

🔥
"everything is a type if you're brave enough"
View GitHub Profile
const perlin = require('perlin-noise');
const Chunk = require('prismarine-chunk')(require("../version"));
const Vec3 = require('vec3').Vec3;
const grassField = require('./grass_field.js').generation;
var chunksToGenerate = 16;
//const Enum = require('enum');
//const dimensionTypes = new Enum(['Overworld' : 0, 'Nether' : -1, 'End' : 1]);
const Chunk = require('prismarine-chunk')(require("../version"));
const Vec3 = require('vec3').Vec3;
function generation() {
function generateSimpleChunk(dx,dy,dz) {
const chunk = new Chunk();
for (let x = (dy*16)-16; x < (dx*16); x++) {
for (let z = (dz*16)-16; z < (dz*16); z++) {
chunk.setBlockType(new Vec3(x, 50, z), 2);
@Matthewacon
Matthewacon / Thread.class native method dump
Created April 1, 2016 17:07
Testing the Reflection API
Method name: 'isInterrupted'
Modifiers:
- PRIVATE
- NATIVE
Method name: 'currentThread'
Modifiers:
- PUBLIC
- STATIC
- NATIVE
Method name: 'registerNatives'
@Matthewacon
Matthewacon / Duration
Created April 1, 2016 20:16
Calculation times for the reflections library over 100 iterations, in milliseconds.
16
18
20
22
24
26
27
29
31
36
@Matthewacon
Matthewacon / dem brackets
Created April 1, 2016 20:54
much bracket such api
public static ArrayList<Member> retrieveAllDeclaredMatching(Class<?> c, ObjectModifier... ob) {
return new ArrayList<Member>() {
{
First: for (ObjectModifier o : ob) {
Second: for (Member m : new ArrayList<Member>() {
{
for (Method m : c.getDeclaredMethods()) {
add(m);
}
for (Field f : c.getDeclaredFields()) {
@Matthewacon
Matthewacon / why
Created April 1, 2016 22:46
wtf did I do
parentChildMap = new LinkedHashMap<Map<Object, Map<Enums.ChildThreadStates, Enums.StateEnums>>, Map<ConcurrentThread, Map<Enums.ChildThreadStates, Enums.StateEnums>>>
@Matthewacon
Matthewacon / TODO.md
Last active April 2, 2016 02:03
lobboostj's todo

TODO

General

  • API
  • Documentation
  • Tests
  • Obfuscation
  • CI build server
  • Automatic Releases
  • Wiki with examples
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package sun.reflect;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import sun.reflect.FieldAccessor;
Method name: 'name'
Modifiers:
- PRIVATE
- VOLATILE
Value:
- [C@61bbe9ba
Method name: 'priority'
Modifiers:
java.lang.NoSuchMethodError: net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.getNameForObject(Ljava/lang/Object;)Lnet/minecraft/util/ResourceLocation;
at mezz.jei.util.StackHelper.getUniqueIdentifierForStack(StackHelper.java:354) ~[StackHelper.class:?]
at mezz.jei.ItemRegistryFactory.addItemStack(ItemRegistryFactory.java:147) ~[ItemRegistryFactory.class:?]
at mezz.jei.ItemRegistryFactory.createItemRegistry(ItemRegistryFactory.java:58) ~[ItemRegistryFactory.class:?]
at mezz.jei.ProxyCommonClient.startJEI(ProxyCommonClient.java:151) ~[ProxyCommonClient.class:?]
at mezz.jei.ProxyCommonClient.onEntityJoinedWorld(ProxyCommonClient.java:136) ~[ProxyCommonClient.class:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_ProxyCommonClient_onEntityJoinedWorld_EntityJoinWorldEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.EventB