use of net.minecraftforge.eventbus.api.Event in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method onScreenMouseClickedPost.
public static boolean onScreenMouseClickedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) {
Event event = new ScreenEvent.MouseClickedEvent.Post(guiScreen, mouseX, mouseY, button, handled);
MinecraftForge.EVENT_BUS.post(event);
return event.getResult() == Event.Result.DEFAULT ? handled : event.getResult() == Event.Result.ALLOW;
}
use of net.minecraftforge.eventbus.api.Event in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method onScreenMouseReleasedPost.
public static boolean onScreenMouseReleasedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) {
Event event = new ScreenEvent.MouseReleasedEvent.Post(guiScreen, mouseX, mouseY, button, handled);
MinecraftForge.EVENT_BUS.post(event);
return event.getResult() == Event.Result.DEFAULT ? handled : event.getResult() == Event.Result.ALLOW;
}
use of net.minecraftforge.eventbus.api.Event in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method onScreenMouseScrollPre.
public static boolean onScreenMouseScrollPre(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) {
Window mainWindow = guiScreen.getMinecraft().getWindow();
double mouseX = mouseHelper.xpos() * (double) mainWindow.getGuiScaledWidth() / (double) mainWindow.getScreenWidth();
double mouseY = mouseHelper.ypos() * (double) mainWindow.getGuiScaledHeight() / (double) mainWindow.getScreenHeight();
Event event = new ScreenEvent.MouseScrollEvent.Pre(guiScreen, mouseX, mouseY, scrollDelta);
return MinecraftForge.EVENT_BUS.post(event);
}
use of net.minecraftforge.eventbus.api.Event in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method onScreenMouseScrollPost.
public static boolean onScreenMouseScrollPost(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) {
Window mainWindow = guiScreen.getMinecraft().getWindow();
double mouseX = mouseHelper.xpos() * (double) mainWindow.getGuiScaledWidth() / (double) mainWindow.getScreenWidth();
double mouseY = mouseHelper.ypos() * (double) mainWindow.getGuiScaledHeight() / (double) mainWindow.getScreenHeight();
Event event = new ScreenEvent.MouseScrollEvent.Post(guiScreen, mouseX, mouseY, scrollDelta);
return MinecraftForge.EVENT_BUS.post(event);
}
use of net.minecraftforge.eventbus.api.Event in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method onRecipesUpdated.
public static void onRecipesUpdated(RecipeManager mgr) {
Event event = new RecipesUpdatedEvent(mgr);
MinecraftForge.EVENT_BUS.post(event);
}
Aggregations