Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The Creeper Temper mod. Creepers turn red as they start igniting.
package vazkii.creepertemper;
import net.minecraft.client.renderer.entity.RenderCreeper;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
@Mod(modid = "CreeperTemper", name = "Creeper Temper", version = "1.0")
public class CreeperTemper extends RenderCreeper {
@EventHandler
public void registry(FMLPostInitializationEvent event) {
RenderingRegistry.registerEntityRenderingHandler(EntityCreeper.class, this);
}
@Override
protected ResourceLocation func_110829_a(EntityCreeper par1EntityCreeper) {
if(par1EntityCreeper.getCreeperState() == 1) {
float antired = 1F - (par1EntityCreeper.getCreeperFlashIntensity(0F) / 1.17F + 0.1F);
GL11.glColor3f(1F, antired, antired);
}
return super.func_110829_a(par1EntityCreeper);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.