-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix destroy block animation like 1.12 (#679)
- Loading branch information
1 parent
72c13cf
commit d96ac28
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...gtnewhorizons/angelica/mixins/early/angelica/bugfixes/MixinRenderGlobal_DestroyBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.gtnewhorizons.angelica.mixins.early.angelica.bugfixes; | ||
|
||
import com.gtnewhorizons.angelica.glsm.GLStateManager; | ||
import com.gtnewhorizons.angelica.glsm.texture.TextureInfo; | ||
import com.gtnewhorizons.angelica.glsm.texture.TextureInfoCache; | ||
import com.llamalad7.mixinextras.sugar.Share; | ||
import com.llamalad7.mixinextras.sugar.ref.LocalIntRef; | ||
import net.minecraft.client.renderer.RenderGlobal; | ||
import net.minecraft.client.renderer.Tessellator; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import org.lwjgl.opengl.GL11; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(RenderGlobal.class) | ||
public class MixinRenderGlobal_DestroyBlock { | ||
@Inject( | ||
method = "drawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;startDrawingQuads()V"), | ||
remap = false | ||
) | ||
private void iris$beginDrawBlockDamageTexture(Tessellator tessellator, EntityLivingBase entity, float partialTicks, CallbackInfo ci, @Share("lastMin") LocalIntRef lastMin, @Share("lastMag") LocalIntRef lastMag) { | ||
TextureInfo info = TextureInfoCache.INSTANCE.getInfo(GLStateManager.getBoundTexture()); | ||
lastMin.set(info.getMinFilter()); | ||
lastMag.set(info.getMagFilter()); | ||
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); | ||
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); | ||
} | ||
|
||
@Inject( | ||
method = "drawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V", | ||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glPopMatrix()V"), | ||
remap = false | ||
) | ||
private void iris$endDrawBlockDamageTexture(Tessellator tessellator, EntityLivingBase entity, float partialTicks, CallbackInfo ci, @Share("lastMin") LocalIntRef lastMin, @Share("lastMag") LocalIntRef lastMag) { | ||
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, lastMin.get()); | ||
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, lastMag.get()); | ||
} | ||
} |