forked from IrisShaders/Iris
-
Notifications
You must be signed in to change notification settings - Fork 65
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
5 changed files
with
101 additions
and
2 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
49 changes: 49 additions & 0 deletions
49
src/main/java/net/coderbot/iris/mixin/compat/CompatMixinPlugin.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,49 @@ | ||
package net.coderbot.iris.mixin.compat; | ||
|
||
import net.minecraftforge.fml.loading.FMLLoader; | ||
import org.objectweb.asm.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class CompatMixinPlugin implements IMixinConfigPlugin { | ||
@Override | ||
public void onLoad(String mixinPackage) { | ||
|
||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
int startIndex = mixinClassName.indexOf("compat.") + "compat.".length(); | ||
int endIndex = mixinClassName.indexOf(".", startIndex); | ||
String modid = mixinClassName.substring(startIndex, endIndex); | ||
return FMLLoader.getLoadingModList().getModFileById(modid) != null; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
|
||
@Override | ||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/net/coderbot/iris/mixin/compat/epicfight/MixinEpicFightRenderTypes.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,27 @@ | ||
package net.coderbot.iris.mixin.compat.epicfight; | ||
|
||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.RenderType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import yesman.epicfight.client.renderer.EpicFightRenderTypes; | ||
|
||
@Mixin(EpicFightRenderTypes.class) | ||
public class MixinEpicFightRenderTypes { | ||
|
||
@Shadow | ||
private static RenderType enchantedAnimatedArmor() { | ||
return null; | ||
} | ||
|
||
@Inject(method = "getArmorVertexBuilder", at = @At("HEAD"), cancellable = true) | ||
private static void getArmorVertexBuilder(MultiBufferSource buffer, RenderType renderType, boolean withGlint, CallbackInfoReturnable<VertexConsumer> cir) { | ||
if(withGlint) | ||
cir.setReturnValue(buffer.getBuffer(enchantedAnimatedArmor())); | ||
} | ||
|
||
} |
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,14 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "net.coderbot.iris.mixin.compat", | ||
"plugin": "net.coderbot.iris.mixin.compat.CompatMixinPlugin", | ||
"refmap": "oculus-refmap.json", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": [ | ||
"epicfight.MixinEpicFightRenderTypes" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |