mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 05:19:41 +00:00
Merge Dev into Experimental
This commit is contained in:
commit
ea217dde75
21 files changed
+746
-81
No files matched your search
@@ -6,18 +6,22 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import noppes.npcs.config.ConfigMixin;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.renderer.RenderCNPCPlayer;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
import noppes.npcs.controllers.data.FramePart;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
@@ -195,7 +199,26 @@ public class ClientEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderHand(RenderHandEvent event) {
|
||||
partialHandTicks = event.partialTicks;
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (ConfigMixin.FirstPersonAnimationMixin && ClientCacheHandler.playerAnimations.containsKey(player.getUniqueID())) {
|
||||
Render playerRenderer = RenderManager.instance.getEntityRenderObject(player);
|
||||
if (playerRenderer instanceof RendererLivingEntity) {
|
||||
ClientEventHandler.renderer = (RendererLivingEntity) playerRenderer;
|
||||
}
|
||||
ClientEventHandler.renderingPlayer = player;
|
||||
ClientEventHandler.partialRenderTick = Minecraft.getMinecraft().timer.renderPartialTicks;
|
||||
partialHandTicks = event.partialTicks;
|
||||
|
||||
AnimationData animData = ClientCacheHandler.playerAnimations.get(player.getUniqueID());
|
||||
if (animData != null && animData.isActive()) {
|
||||
Frame frame = (Frame) animData.animation.currentFrame();
|
||||
if (frame.frameParts.containsKey(EnumAnimationPart.FULL_MODEL)) {
|
||||
FramePart part = frame.frameParts.get(EnumAnimationPart.FULL_MODEL);
|
||||
part.interpolateOffset();
|
||||
part.interpolateAngles();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasOverlays(EntityPlayer player) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GuiNpcAI extends GuiNPCInterface2 implements ITextfieldListener, IG
|
||||
addLabel(new GuiNpcLabel(11,"ai.return", guiLeft + 150, guiTop + 40));
|
||||
addButton(new GuiNpcButton(6, guiLeft + 230, guiTop + 35, 60, 20, new String[]{"gui.no","gui.yes"} ,npc.ai.returnToStart ? 1:0));
|
||||
addLabel(new GuiNpcLabel(17,"ai.leapattarget", guiLeft + 150, guiTop + 65));
|
||||
addButton(new GuiNpcButton(15,guiLeft + 230, guiTop + 60, 60, 20, new String[]{"gui.no", "gui.yes"} ,npc.ai.canLeap ? 1:0));
|
||||
addButton(new GuiNpcButton(15,guiLeft + 230, guiTop + 60, 60, 20, new String[]{"gui.no", "ai.jump", "ai.pounce"} ,npc.ai.leapType));
|
||||
addLabel(new GuiNpcLabel(15, "ai.indirect", guiLeft + 150, guiTop + 90));
|
||||
addButton(new GuiNpcButton(13, guiLeft + 230, guiTop + 85, 60, 20, new String[]{"gui.no", "gui.whendistant", "gui.whenhidden"}, ai.canFireIndirect));
|
||||
addLabel(new GuiNpcLabel(16, "ai.rangemelee", guiLeft + 150, guiTop + 115));
|
||||
@@ -129,7 +129,7 @@ public class GuiNpcAI extends GuiNPCInterface2 implements ITextfieldListener, IG
|
||||
initGui();
|
||||
}
|
||||
else if (button.id == 15) {
|
||||
ai.canLeap = (button.getValue() == 1);
|
||||
ai.leapType = (byte) button.getValue();
|
||||
}
|
||||
else if (button.id == 16) {
|
||||
ai.canSprint = (button.getValue() == 1);
|
||||
|
||||
Reference in new issue
Block a user