Skip to content

Instantly share code, notes, and snippets.

View bernie-g's full-sized avatar
💭
Check out geckolib.com!

Bernie G bernie-g

💭
Check out geckolib.com!
View GitHub Profile
@kamilogorek
kamilogorek / _screenshot.md
Last active May 29, 2025 21:24
Clutter-free VS Code Setup
image
@bernie-g
bernie-g / ReplacedTextureModel.java
Last active July 20, 2024 10:43
This replaces a texture in an IBakedModel by changing each BakedQuad's UV coordinates. You should use this by calling the constructor with your old model and your new TextureAtlasSprite.
/*
* Copyright (c) 2020.
* Author: Bernie G. (Gecko)
*/
package software.bernie.gist;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
package net.minecraft.client.gui;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@williewillus
williewillus / porting.md
Created January 22, 2017 04:57
how to port a mod

Only half-serious, as opposed to 3/4 serious. Take of it what you will.

  1. Update your gradle and mappings. Get it wrong because you forgot to add the branch name.
  2. Commit so you feel good about taking the first step
  3. Rerun setupDecompWorkspace, refresh Gradle project in your IDE.
  4. Try to compile the mod and cry after seeing the error count
  5. Easy renaming time. If a class (or method/field with distinct name) has been renamed, just do a global find/replace. Congrats, you just added 10000 lines to the diff. Commit.
  6. Easy method signature time. If a method has changed arguments, say to add a hand parameter, just do a global find/replace. You DID name your parameters properly, not p_10101101010_xxx, right? ... Oho, you're going to have fun. Commit.
  7. Easy semantic stuff. This is stuff like changing x y z args to BlockPos, ForgeDirection to EnumFacing, etc. Commit per change.
  8. Missing methods. If something you override from vanilla is no longer there, first check the bot to see if it got renamed (!mh