mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 15:45:10 +00:00
1.7.10 Files
Files added
This commit is contained in:
1 parent
393ea9b463
commit
a31efb2dc3
1768 files changed
+84831
No files matched your search
@@ -0,0 +1,55 @@
|
||||
package noppes.npcs.client;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.inventory.ContainerPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.client.controllers.MusicController;
|
||||
import noppes.npcs.client.gui.player.GuiQuestLog;
|
||||
import noppes.npcs.client.renderer.RenderNPCInterface;
|
||||
import noppes.npcs.constants.EnumPlayerPacket;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
public class ClientTickHandler{
|
||||
|
||||
private World prevWorld;
|
||||
private boolean otherContainer = false;
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onClientTick(TickEvent.ClientTickEvent event){
|
||||
if(event.phase == Phase.END)
|
||||
return;
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(mc.thePlayer != null && mc.thePlayer.openContainer instanceof ContainerPlayer){
|
||||
if(otherContainer){
|
||||
NoppesUtilPlayer.sendData(EnumPlayerPacket.CheckQuestCompletion);
|
||||
otherContainer = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
otherContainer = true;
|
||||
CustomNpcs.ticks++;
|
||||
RenderNPCInterface.LastTextureTick++;
|
||||
if(prevWorld != mc.theWorld){
|
||||
prevWorld = mc.theWorld;
|
||||
MusicController.Instance.stopMusic();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKey(InputEvent.KeyInputEvent event){
|
||||
if(ClientProxy.QuestLog.isPressed()){
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(mc.currentScreen == null)
|
||||
NoppesUtil.openGUI(mc.thePlayer, new GuiQuestLog(mc.thePlayer));
|
||||
else if(mc.currentScreen instanceof GuiQuestLog)
|
||||
mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user