Merge branch 'mouseevent2' of github.com:MachineMuse/MinecraftForge into sometweaks
This commit is contained in:
commit
21cd975ae3
|
@ -6,6 +6,7 @@ import java.util.TreeSet;
|
|||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
@ -325,6 +326,10 @@ public class ForgeHooksClient
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean postMouseEvent() {
|
||||
return MinecraftForge.EVENT_BUS.post(new MouseEvent());
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialization of Forge Renderers.
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
* Created: 2:46 PM, 9/4/13
|
||||
*/
|
||||
@Cancelable
|
||||
public class MouseEvent extends Event {
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int dx;
|
||||
public final int dy;
|
||||
public final int dwheel;
|
||||
public final int button;
|
||||
public final boolean buttonstate;
|
||||
public final long nanoseconds;
|
||||
|
||||
public MouseEvent() {
|
||||
this.x = Mouse.getEventX();
|
||||
this.y = Mouse.getEventY();
|
||||
this.dx = Mouse.getEventDX();
|
||||
this.dy = Mouse.getEventDY();
|
||||
this.dwheel = Mouse.getEventDWheel();
|
||||
this.button = Mouse.getEventButton();
|
||||
this.buttonstate = Mouse.getEventButtonState();
|
||||
this.nanoseconds = Mouse.getEventNanoseconds();
|
||||
}
|
||||
}
|
|
@ -62,6 +62,15 @@
|
|||
{
|
||||
this.entityRenderer.itemRenderer.resetEquippedProgress2();
|
||||
}
|
||||
@@ -1575,7 +1585,7 @@
|
||||
while (Mouse.next())
|
||||
{
|
||||
i = Mouse.getEventButton();
|
||||
-
|
||||
+ if (ForgeHooksClient.postMouseEvent()) continue;
|
||||
if (field_142025_a && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157)))
|
||||
{
|
||||
i = 1;
|
||||
@@ -2046,6 +2056,11 @@
|
||||
{
|
||||
this.statFileWriter.syncStats();
|
||||
|
|
Loading…
Reference in New Issue