mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 14:27:59 +01:00
Make magic slightly brighter
This commit is contained in:
parent
446a38b2fc
commit
63d69d026a
4 changed files with 21 additions and 9 deletions
|
@ -5,11 +5,10 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import com.minelittlepony.render.LevitatingItemRenderer;
|
||||
import com.minelittlepony.render.PonySkullRenderer;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.GlStateManager.DestFactor;
|
||||
import net.minecraft.client.renderer.GlStateManager.SourceFactor;
|
||||
|
||||
@Mixin(GlStateManager.class)
|
||||
public abstract class MixinGlStateManager {
|
||||
|
@ -17,8 +16,7 @@ public abstract class MixinGlStateManager {
|
|||
@Inject(method = "enableBlendProfile(Lnet/minecraft/client/renderer/GlStateManager$Profile;)V", at = @At("HEAD"), cancellable = true)
|
||||
private static void enableBlendProfile(GlStateManager.Profile profile, CallbackInfo info) {
|
||||
if (profile == GlStateManager.Profile.PLAYER_SKIN && PonySkullRenderer.ponyInstance.usesTransparency()) {
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.tryBlendFuncSeparate(SourceFactor.CONSTANT_COLOR, DestFactor.ONE, SourceFactor.ONE, DestFactor.ZERO);
|
||||
LevitatingItemRenderer.enableItemGlowRenderProfile();
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package com.minelittlepony.mixin;
|
||||
|
||||
import com.minelittlepony.ducks.IRenderItem;
|
||||
import com.minelittlepony.render.LevitatingItemRenderer;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.GlStateManager.DestFactor;
|
||||
import net.minecraft.client.renderer.GlStateManager.SourceFactor;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
|
@ -29,7 +27,7 @@ public abstract class MixinRenderItem implements IResourceManagerReloadListener,
|
|||
@Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/renderer/block/model/IBakedModel;)V", at = @At("HEAD"))
|
||||
private void onRenderItem(ItemStack stack, IBakedModel model, CallbackInfo info) {
|
||||
if (transparency) {
|
||||
GlStateManager.tryBlendFuncSeparate(SourceFactor.CONSTANT_COLOR, DestFactor.ONE, SourceFactor.ONE, DestFactor.ZERO);
|
||||
LevitatingItemRenderer.enableItemGlowRenderProfile();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,11 @@ import static net.minecraft.client.renderer.GlStateManager.color;
|
|||
|
||||
import com.minelittlepony.util.coordinates.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class HornGlowRenderer extends AbstractPonyRenderer<HornGlowRenderer> {
|
||||
|
||||
int tint;
|
||||
|
@ -38,8 +41,10 @@ public class HornGlowRenderer extends AbstractPonyRenderer<HornGlowRenderer> {
|
|||
|
||||
@Override
|
||||
public void render(float scale) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
Minecraft.getMinecraft().entityRenderer.disableLightmap();
|
||||
super.render(scale);
|
||||
color(1, 1, 1, 1);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony.render;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL14;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
|
@ -10,8 +11,12 @@ import com.mumfrey.liteloader.client.overlays.IMinecraft;
|
|||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.client.renderer.GlStateManager.DestFactor;
|
||||
import net.minecraft.client.renderer.GlStateManager.SourceFactor;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.EnumAction;
|
||||
|
@ -21,6 +26,12 @@ import static net.minecraft.client.renderer.GlStateManager.*;
|
|||
|
||||
public class LevitatingItemRenderer {
|
||||
|
||||
public static void enableItemGlowRenderProfile() {
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.tryBlendFuncSeparate(SourceFactor.CONSTANT_COLOR, DestFactor.ONE, SourceFactor.ONE, DestFactor.ZERO);
|
||||
Minecraft.getMinecraft().entityRenderer.disableLightmap();
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a magical overlay over an item in third person.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue