net.minecraftforge.eventbus.api.EventPriority Java Examples

The following examples show how to use net.minecraftforge.eventbus.api.EventPriority. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CCRenderEventHandler.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
@OnlyIn (Dist.CLIENT)
@SubscribeEvent (priority = EventPriority.LOW)
public void onBlockHighlight(DrawHighlightEvent.HighlightBlock event) {
    //We have found a CuboidRayTraceResult, Lets render it properly..
    BlockRayTraceResult hit = event.getTarget();
    if (hit instanceof CuboidRayTraceResult) {
        CuboidRayTraceResult cuboidHit = (CuboidRayTraceResult) hit;
        event.setCanceled(true);
        Matrix4 mat = new Matrix4(event.getMatrix());
        mat.translate(cuboidHit.getPos());
        RenderUtils.bufferHitbox(mat, event.getBuffers(), event.getInfo(), cuboidHit.cuboid6);
    }
}
 
Example #2
Source File: ClientEventHandler.java    From Better-Sprinting with Mozilla Public License 2.0 5 votes vote down vote up
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public static void onGuiOpen(GuiOpenEvent e){
	if (stopCheckingNewServer && mc.getRenderViewEntity() == null){
		ClientModManager.onDisconnectedFromServer();
		IntegrityCheck.unregister();
		LivingUpdate.cleanup();
		stopCheckingNewServer = false;
		showDisableWarningWhenPossible = false;
	}
}
 
Example #3
Source File: GuiOverlay.java    From XRay-Mod with GNU General Public License v3.0 5 votes vote down vote up
@OnlyIn(Dist.CLIENT)
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void RenderGameOverlayEvent(RenderGameOverlayEvent event) {
    // Draw Indicator
    if(!Controller.isXRayActive() || !Configuration.general.showOverlay.get() || event.isCanceled() || event.getType() != RenderGameOverlayEvent.ElementType.TEXT )
        return;

    RenderSystem.color3f(0, 255, 0);
    XRay.mc.getTextureManager().bindTexture(circle);
    Screen.func_238463_a_(event.getMatrixStack(), 5, 5, 0f, 0f, 5, 5, 5, 5); // @mcp: func_238463_a_ = blit (7 parms) =

    // @mcp: func_238405_a_ = drawStringWithShadow
    XRay.mc.fontRenderer.func_238405_a_(event.getMatrixStack(), I18n.format("xray.overlay"), 15, 4, 0xffffffff);
}