-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test fixing EMF support in Compatebility mode/1.21.3
- Loading branch information
Showing
20 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/main/java/dev/tr7zw/skinlayers/accessor/ModelPartInjector.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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
package dev.tr7zw.skinlayers.accessor; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
|
||
import dev.tr7zw.skinlayers.api.Mesh; | ||
import dev.tr7zw.skinlayers.api.OffsetProvider; | ||
|
||
public interface ModelPartInjector { | ||
|
||
public void setInjectedMesh(Mesh mesh, OffsetProvider offsetProvider); | ||
|
||
public boolean isVisible(); | ||
|
||
public Mesh getInjectedMesh(); | ||
|
||
public OffsetProvider getOffsetProvider(); | ||
|
||
public void prepareTranslateAndRotate(PoseStack poseStack); | ||
|
||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/dev/tr7zw/skinlayers/mixin/EMFModelPartMixin.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,55 @@ | ||
|
||
package dev.tr7zw.skinlayers.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
//#if MC >= 12000 && FABRIC || NEOFORGE | ||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
|
||
import dev.tr7zw.skinlayers.accessor.ModelPartInjector; | ||
import traben.entity_model_features.models.parts.EMFModelPart; | ||
|
||
@Pseudo | ||
@Mixin(EMFModelPart.class) | ||
public abstract class EMFModelPartMixin implements ModelPartInjector { | ||
|
||
// spotless:off | ||
//#if MC >= 12100 | ||
@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;III)V", at = @At(value = "HEAD"), cancellable = true) | ||
public void render(PoseStack poseStack, VertexConsumer vertexConsumer, int light, int overlay, int color, | ||
CallbackInfo ci) { | ||
if (isVisible() && getInjectedMesh() != null) { | ||
poseStack.pushPose(); | ||
prepareTranslateAndRotate(poseStack); | ||
getOffsetProvider().applyOffset(poseStack, getInjectedMesh()); | ||
getInjectedMesh().render(null, poseStack, vertexConsumer, light, overlay, color); | ||
poseStack.popPose(); | ||
ci.cancel(); | ||
} | ||
} | ||
//#else | ||
//$$ @Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;IIFFFF)V", at = @At(value = "HEAD"), cancellable = true) | ||
//$$ public void render(PoseStack poseStack, VertexConsumer vertexConsumer, int light, int overlay, float red, float green, float blue, float alpha, | ||
//$$ CallbackInfo ci) { | ||
//$$ if (isVisible() && getInjectedMesh() != null) { | ||
//$$ poseStack.pushPose(); | ||
//$$ prepareTranslateAndRotate(poseStack); | ||
//$$ getOffsetProvider().applyOffset(poseStack, getInjectedMesh()); | ||
//$$ getInjectedMesh().render(null, poseStack, vertexConsumer, light, overlay, red, green, blue, alpha); | ||
//$$ poseStack.popPose(); | ||
//$$ ci.cancel(); | ||
//$$ } | ||
//$$ } | ||
//$$ | ||
//#endif | ||
// spotless:on | ||
|
||
} | ||
//#else | ||
//$$ @Mixin(net.minecraft.client.Minecraft.class) | ||
//$$ public abstract class EMFModelPartMixin{} // DUMMY | ||
//#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:QoWmvvjv' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:TkjKemrg' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:cnCqWodo' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:cnCqWodo' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:cnCqWodo' | ||
} |
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,3 @@ | ||
dependencies { | ||
modCompileOnlyApi 'maven.modrinth:entity-model-features:cnCqWodo' | ||
} |