Skip to content

Instantly share code, notes, and snippets.

@bs2609
bs2609 / ExampleMod.java
Created October 27, 2017 13:46
Updated example mod
package com.example.examplemod;
import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;
@Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION)
@bs2609
bs2609 / gist:9ed4b282f3e703c53714abd8cbbd50d5
Last active September 22, 2017 22:44
Registry ID reclaimation idea?
We have an int 'version' for registries, which is incremented whenever (existing?) id mappings change.
We also have an int->int versioning map for the id mappings, which stores the registry version that last altered the mapping for each id.
We save the registry version number into save data, alongside minecraft's own "DataVersion" number.
We can then setup datafixers to run if the current registry version is not the registry version the data was saved under.
If the 'last changed' version for a given id is greater than the saved data's registry version, then the saved id no longer represents the correct data and should be dummied out.
@bs2609
bs2609 / README.md
Last active December 30, 2017 15:36
README update

How to install Forge: For Players

Go to https://files.minecraftforge.net and select the Minecraft version you wish to get Forge for from the list.

You can download the installer for the Recommended Build or the Latest Build there. Latest builds may have newer features but may be more unstable as a result. The installer will attempt to install Forge into your vanilla launcher environment, where you can then create a new profile using that version and play the game!

public class EmptyClassInheritanceMultiMap extends ClassInheritanceMultiMap<Entity>
{
public static final EmptyClassInheritanceMultiMap INSTANCE = new EmptyClassInheritanceMultiMap();
private EmptyClassInheritanceMultiMap()
{
super(Entity.class);
}
@Override
package net.minecraftforge.debug;
import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockModelShapes;
import net.minecraft.client.renderer.block.model.BakedQuad;
@bs2609
bs2609 / BlockSnapshot.java
Created March 14, 2017 07:13
Draft cleanup of BlockSnapshot
/*
* Minecraft Forge
* Copyright (c) 2016.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
@bs2609
bs2609 / gist:8f09f9b4c4faa77134745cda5875089d
Created March 4, 2017 08:50
FMLLog calls from patches
client.renderer.texture
Stitcher
doStitch
entity
EntityList
createEntityFromNBT
tileentity
TileEntity
create
util
@bs2609
bs2609 / SimpleBakedModel.java.patch
Created November 6, 2016 04:24
SimpleBakedModel patch
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java
@@ -158,6 +158,8 @@
}
else
{
+ ((java.util.ArrayList<BakedQuad>) field_177656_a).trimToSize();
+ for (List<BakedQuad> list : field_177654_b.values()) ((java.util.ArrayList<BakedQuad>) list).trimToSize();
return new SimpleBakedModel(this.field_177656_a, this.field_177654_b, this.field_177655_c, this.field_177653_e, this.field_177652_d, this.field_177651_f, this.field_188646_c);
}