Java Code Examples for org.lwjgl.input.Mouse.poll()

The following are Jave code examples for showing how to use poll() of the org.lwjgl.input.Mouse class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Mods   File: TF2EventsClient.java   View Source Code Vote up 6 votes
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event) {

	tickTime = event.renderTickTime;
	Minecraft minecraft = Minecraft.getMinecraft();
	if (event.phase == Phase.END)
		if (minecraft.player != null && minecraft.player.getHeldItemMainhand() != null)
			if (minecraft.player.getHeldItemMainhand().getItem() instanceof ItemUsable) {
				Mouse.poll();
				minecraft.player.rotationYawHead = minecraft.player.rotationYaw;
				moveEntities = true;
				keyPressUpdate(Mouse.isButtonDown(minecraft.gameSettings.keyBindAttack.getKeyCode() + 100),
						Mouse.isButtonDown(minecraft.gameSettings.keyBindUseItem.getKeyCode() + 100));
				moveEntities = false;
			}
}