mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 04:35:03 +00:00
Added player rotations/pivots/animations, similar to NPC's.
This commit is contained in:
1 parent
d638c98d81
commit
51263a9f82
13 files changed
+726
-10
No files matched your search
@@ -2,12 +2,12 @@ package noppes.npcs.client;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.renderer.RenderCNPCPlayer;
|
||||
|
||||
@@ -20,6 +20,10 @@ public class ClientEventHandler {
|
||||
public static HashMap<Integer,Long> disabledButtonTimes = new HashMap<>();
|
||||
public static float partialHandTicks;
|
||||
|
||||
public static float partialRenderTick;
|
||||
public static EntityPlayer renderingPlayer;
|
||||
public static RenderPlayer renderer;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMouse(MouseEvent event) {
|
||||
if (Minecraft.getMinecraft().currentScreen != null)
|
||||
@@ -55,8 +59,17 @@ public class ClientEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderPlayer(RenderPlayerEvent.Pre event) {
|
||||
ClientEventHandler.renderingPlayer = event.entityPlayer;
|
||||
ClientEventHandler.renderer = event.renderer;
|
||||
ClientEventHandler.partialRenderTick = event.partialRenderTick;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderPlayer(RenderPlayerEvent.Post event) {
|
||||
ClientEventHandler.renderingPlayer = null;
|
||||
|
||||
if (hasOverlays(event.entityPlayer)) {
|
||||
try {
|
||||
Class<?> renderPlayerJBRA = Class.forName("JinRyuu.JBRA.RenderPlayerJBRA");
|
||||
|
||||
Reference in new issue
Block a user