mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 11:57:01 -05:00
Merge pull request #23 from architectury/patch/effect-instance
Fix mojank in EffectInstance
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package me.shedaniel.architectury.mixin.fabric.client;
|
||||
|
||||
import com.mojang.blaze3d.shaders.Program;
|
||||
import net.minecraft.client.renderer.EffectInstance;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Unique
|
||||
@Mixin(EffectInstance.class)
|
||||
public class MixinEffectInstance {
|
||||
@Redirect(
|
||||
method = "<init>",
|
||||
at = @At(value = "NEW",
|
||||
target = "(Ljava/lang/String;)Lnet/minecraft/resources/ResourceLocation;",
|
||||
ordinal = 0)
|
||||
)
|
||||
private ResourceLocation mojangPls(String _0, ResourceManager rm, String str) {
|
||||
return mojangPls(new ResourceLocation(str), ".json");
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = "getOrCreate",
|
||||
at = @At(value = "NEW",
|
||||
target = "(Ljava/lang/String;)Lnet/minecraft/resources/ResourceLocation;",
|
||||
ordinal = 0)
|
||||
)
|
||||
private static ResourceLocation mojangPls(String _0, ResourceManager rm, Program.Type type, String str) {
|
||||
return mojangPls(new ResourceLocation(str), type.getExtension());
|
||||
}
|
||||
|
||||
private static ResourceLocation mojangPls(ResourceLocation rl, String ext) {
|
||||
return new ResourceLocation(rl.getNamespace(), "shaders/program/" + rl.getPath() + ext);
|
||||
}
|
||||
}
|
||||
@@ -4,14 +4,39 @@
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"minVersion": "0.7.11",
|
||||
"client": [
|
||||
"client.MixinClientLevel", "client.MixinClientPacketListener", "client.MixinDebugScreenOverlay", "client.MixinGameRenderer", "client.MixinIntegratedServer",
|
||||
"client.MixinKeyboardHandler", "client.MixinMinecraft", "client.MixinMouseHandler", "client.MixinMultiPlayerGameMode", "client.MixinScreen",
|
||||
"client.MixinTextureAtlas"
|
||||
"client.MixinClientLevel",
|
||||
"client.MixinClientPacketListener",
|
||||
"client.MixinDebugScreenOverlay",
|
||||
"client.MixinGameRenderer",
|
||||
"client.MixinIntegratedServer",
|
||||
"client.MixinKeyboardHandler",
|
||||
"client.MixinMinecraft",
|
||||
"client.MixinMouseHandler",
|
||||
"client.MixinMultiPlayerGameMode",
|
||||
"client.MixinScreen",
|
||||
"client.MixinTextureAtlas",
|
||||
"client.MixinEffectInstance"
|
||||
],
|
||||
"mixins": [
|
||||
"ExplosionPreInvoker", "LivingDeathInvoker", "MixinBlockEntityExtension", "MixinBlockItem", "MixinCommands", "MixinDedicatedServer", "MixinExplosion",
|
||||
"MixinFurnaceResultSlot", "MixinItemEntity", "MixinLivingEntity", "MixinPlayer", "MixinPlayerAdvancements", "MixinPlayerList", "MixinResultSlot",
|
||||
"MixinServerGamePacketListenerImpl", "MixinServerLevel", "MixinServerPlayer", "MixinServerPlayerGameMode", "PlayerAttackInvoker"
|
||||
"ExplosionPreInvoker",
|
||||
"LivingDeathInvoker",
|
||||
"MixinBlockEntityExtension",
|
||||
"MixinBlockItem",
|
||||
"MixinCommands",
|
||||
"MixinDedicatedServer",
|
||||
"MixinExplosion",
|
||||
"MixinFurnaceResultSlot",
|
||||
"MixinItemEntity",
|
||||
"MixinLivingEntity",
|
||||
"MixinPlayer",
|
||||
"MixinPlayerAdvancements",
|
||||
"MixinPlayerList",
|
||||
"MixinResultSlot",
|
||||
"MixinServerGamePacketListenerImpl",
|
||||
"MixinServerLevel",
|
||||
"MixinServerPlayer",
|
||||
"MixinServerPlayerGameMode",
|
||||
"PlayerAttackInvoker"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
Reference in New Issue
Block a user