mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 21:15:53 +08:00
[Feat] Add EventRender3D
This commit is contained in:
1 parent
8e914997e8
commit
13b4d4d5c3
3 files changed
+40
No files matched your search
@@ -0,0 +1,13 @@
|
||||
package cn.xiaozhou233.orangex.event.impl;
|
||||
|
||||
import cn.xiaozhou233.orangex.event.Event;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class EventRender3D extends Event {
|
||||
|
||||
private float partialTicks;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.xiaozhou233.orangex.mixin;
|
||||
|
||||
import cn.xiaozhou233.orangex.mixin.impl.MixinEntityRenderer;
|
||||
import cn.xiaozhou233.orangex.mixin.impl.MixinGuiIngame;
|
||||
import cn.xiaozhou233.orangex.mixin.impl.MixinMinecraft;
|
||||
import cn.xiaozhou233.orangex.utils.JuiceLoaderFacade;
|
||||
@@ -44,6 +45,7 @@ public final class MixinManager {
|
||||
try {
|
||||
transformer.addMixin(MixinGuiIngame.class);
|
||||
transformer.addMixin(MixinMinecraft.class);
|
||||
transformer.addMixin(MixinEntityRenderer.class);
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException("Failed to add mixin", e);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.xiaozhou233.orangex.mixin.impl;
|
||||
|
||||
import cn.xiaozhou233.orangex.OrangeX;
|
||||
import cn.xiaozhou233.orangex.event.impl.EventRender3D;
|
||||
import cn.yapeteam.ymixin.annotations.Inject;
|
||||
import cn.yapeteam.ymixin.annotations.Local;
|
||||
import cn.yapeteam.ymixin.annotations.Mixin;
|
||||
import cn.yapeteam.ymixin.annotations.Target;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
|
||||
@Mixin(EntityRenderer.class)
|
||||
public class MixinEntityRenderer {
|
||||
|
||||
@Inject(
|
||||
method = "renderWorldPass", desc = "(IFJ)V",
|
||||
target = @Target(
|
||||
value = "INVOKESTATIC",
|
||||
target = "net/minecraft/client/renderer/GlStateManager.disableFog()V",
|
||||
shift = Target.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void render(@Local(source = "partialTicks", index = 2) float partialTicks) {
|
||||
OrangeX.getInstance().getEventBus().post(new EventRender3D(partialTicks));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user