-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix campfire backport animations (#224)
* Mark animations of crossed squares Fixes Angelica's equivalent of GTNewHorizons/Hodgepodge#264 Fixes Campfire Backport campfire flames not animating (but the embers and the mixed NEI flames are still broken) * Add Campfire Backport compatibility to animation speedup Fixes Angelica's equivalent of GTNewHorizons/Hodgepodge#204 Fixes embers and NEI mixed flames not animating
- Loading branch information
Showing
5 changed files
with
50 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
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
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
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
35 changes: 35 additions & 0 deletions
35
.../gtnewhorizons/angelica/mixins/late/client/campfirebackport/MixinRenderBlockCampfire.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,35 @@ | ||
package com.gtnewhorizons.angelica.mixins.late.client.campfirebackport; | ||
|
||
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.ModifyArgs; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args; | ||
|
||
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache; | ||
import com.gtnewhorizons.angelica.utils.AnimationsRenderUtils; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.client.renderer.RenderBlocks; | ||
import net.minecraft.util.IIcon; | ||
|
||
@Mixin(targets = "connor135246.campfirebackport.client.rendering.RenderBlockCampfire", remap = false) | ||
public class MixinRenderBlockCampfire { | ||
@Inject(method = "renderFace", at = @At("HEAD")) | ||
private static void angelica$beforeRenderFace(double x, double y, double z, Block block, RenderBlocks renderer, IIcon icon, int side, CallbackInfo ci) { | ||
AnimationsRenderUtils.markBlockTextureForUpdate(icon, renderer.blockAccess); | ||
((ITexturesCache)renderer).getRenderedTextures().add(icon); | ||
} | ||
|
||
@ModifyArgs(method = "renderFire", at = @At(value = "INVOKE", target = "Lconnor135246/campfirebackport/client/rendering/RenderBlockCampfire;drawCrossedSquaresTwoIcons(Lnet/minecraft/util/IIcon;Lnet/minecraft/util/IIcon;DDDF)V")) | ||
private static void angelica$onDrawCrossedSquaresTwoIcons(Args args, double x, double y, double z, Block block, RenderBlocks renderer, boolean mix) { | ||
IIcon icon1 = (IIcon)args.get(0); | ||
AnimationsRenderUtils.markBlockTextureForUpdate(icon1, renderer.blockAccess); | ||
((ITexturesCache)renderer).getRenderedTextures().add(icon1); | ||
|
||
IIcon icon2 = (IIcon)args.get(1); | ||
AnimationsRenderUtils.markBlockTextureForUpdate(icon2, renderer.blockAccess); | ||
((ITexturesCache)renderer).getRenderedTextures().add(icon2); | ||
} | ||
} |