-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
936 additions
and
216 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,6 @@ pluginManagement { | |
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "LegacyAnimations" |
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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/mixces/legacyanimations/duck/PlayerPitchInterface.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,9 @@ | ||
package com.mixces.legacyanimations.duck; | ||
|
||
public interface PlayerPitchInterface { | ||
|
||
float legacyAnimations$getPrevPlayerPitch(); | ||
|
||
float legacyAnimations$getPlayerPitch(); | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/mixces/legacyanimations/hook/EntityHook.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,13 @@ | ||
package com.mixces.legacyanimations.hook; | ||
|
||
import net.minecraft.entity.LivingEntity; | ||
|
||
public class EntityHook { | ||
|
||
public static LivingEntity entity; | ||
|
||
public static boolean isEntityDying() { | ||
return entity.deathTime > 0 || entity.hurtTime > 0; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/mixces/legacyanimations/mixin/ArmorFeatureRendererMixin.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,46 @@ | ||
package com.mixces.legacyanimations.mixin; | ||
|
||
import com.mixces.legacyanimations.config.LegacyAnimationsSettings; | ||
import com.mixces.legacyanimations.hook.EntityHook; | ||
import net.minecraft.client.render.OverlayTexture; | ||
import net.minecraft.client.render.RenderLayer; | ||
import net.minecraft.client.render.entity.feature.ArmorFeatureRenderer; | ||
import net.minecraft.util.Identifier; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyArg; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ArmorFeatureRenderer.class) | ||
public abstract class ArmorFeatureRendererMixin { | ||
|
||
@Redirect( | ||
method = "renderArmorParts", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/render/RenderLayer;getArmorCutoutNoCull(Lnet/minecraft/util/Identifier;)Lnet/minecraft/client/render/RenderLayer;" | ||
) | ||
) | ||
private RenderLayer useEntityLayerRenderer(Identifier texture) { | ||
if (LegacyAnimationsSettings.CONFIG.instance().armorTint) { | ||
return RenderLayer.getEntityCutoutNoCullZOffset(texture); | ||
} | ||
return RenderLayer.getArmorCutoutNoCull(texture); | ||
} | ||
|
||
@ModifyArg( | ||
method = "renderArmorParts", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/render/entity/model/BipedEntityModel;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;IIFFFF)V" | ||
), | ||
index = 3 | ||
) | ||
private int useDamageUVOverlay(int par3) { | ||
if (LegacyAnimationsSettings.CONFIG.instance().armorTint) { | ||
return OverlayTexture.packUv(OverlayTexture.getU(0.0F), OverlayTexture.getV(EntityHook.isEntityDying())); | ||
} | ||
return par3; | ||
} | ||
|
||
} |
Oops, something went wrong.