当前位置: 首页>>代码示例>>Java>>正文


Java RenderTickEvent类代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent的典型用法代码示例。如果您正苦于以下问题:Java RenderTickEvent类的具体用法?Java RenderTickEvent怎么用?Java RenderTickEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RenderTickEvent类属于net.minecraftforge.fml.common.gameevent.TickEvent包,在下文中一共展示了RenderTickEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@Override
public void tick(TickEvent event) {
	super.tick(event);

	if(event instanceof ClientTickEvent) {
		while(!clientTickQeue.isEmpty())
			clientTickQeue.poll().run();
	}
	if(event instanceof RenderTickEvent) {
		RenderTickEvent revt = (RenderTickEvent) event;

		// Pre-Scene Render
		if(revt.phase == Phase.START) {
			clientRenderer.on_render_world_terrain_pre(revt);
		} else
			// Post-World >> Pre-HUD Render
			if(revt.phase == Phase.END) {
				clientRenderer.on_render_world_terrain_post(revt);
			}
	}
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:22,代码来源:ClientProxy.java

示例2: onRenderTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent e) {
    if (!isEnabled()) {
        return;
    }

    // only record at the end of the frame
    if (e.phase == Phase.START) {
        return;
    }

    // stop at frame limit
    if (frameLimit > 0 && time.getNumFrames() >= frameLimit) {
        disable();
    }

    // skip frames if the capturing framerate is not synchronized with the
    // rendering framerate
    if (!cfg.isSyncEngine() && !time.isNextFrame()) {
        // Game renders faster than necessary for recording?
        return;
    }

    postFrameEvent(new FrameImportEvent(frame, time, movieDir));
}
 
开发者ID:ata4,项目名称:minema,代码行数:26,代码来源:CaptureSession.java

示例3: onRenderTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent evt) {
    if (task == null) {
        return;
    }
    
    try {
        if (task.onRenderTick(evt)) {
            task = null;
            ChatUtils.printFileLink("screenshot.success", taskFile.toFile());
        }
    } catch (Exception ex) {
        L.error("Screenshot capture failed", ex);
        ChatUtils.print("screenshot.failure", ex.getMessage());
        task = null;
    }
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:18,代码来源:ScreenshotHandler.java

示例4: onRender

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
/**
 * Called before and after the rendering of the world.
 * 
 * @param event
 *            Contains information about the event.
 */
@SubscribeEvent
public void onRender(RenderTickEvent event)
{
    if( event.phase == Phase.START )
    {
        // this is here in case the user has resized the window during a mission
        resizeIfNeeded();
    }
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:16,代码来源:VideoHook.java

示例5: tick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tick(RenderTickEvent event) {
    if (tickDelay++ <= 20) return;
    // This is FPS-based, not worldtick based. It just needs to happen occasionally
    tickDelay = 0;
    if (event.phase == Phase.START) {
        tickStart();
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:10,代码来源:RenderDimensionSliceEntity.java

示例6: onPlayerRenderTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
/** Handle rendering updates */
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onPlayerRenderTick(RenderTickEvent e) {
	EntityPlayer player = Minecraft.getMinecraft().thePlayer; if(player == null) return;
	
	// handle potion rendering
	handleClientPotionEffects(player);
}
 
开发者ID:sblectric,项目名称:LightningCraft,代码行数:10,代码来源:PlayerEvents.java

示例7: on_render_world_terrain_pre

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
public void on_render_world_terrain_pre(RenderTickEvent revt) {
	if(mc.world != null) {
		// Which VisualMode should we use?
		VisualMode visMode = visualizationMode;
		
		// Prevent non-creative players from using the visualization modes.
		if(!proxy.isBuildMode()) {
			visMode = VisualMode.Default;
		}
		
		// this takes care of the CUSTOM SKY RENDERING
		if(mc.world.provider != null) {
			boolean debugSkyActive = visMode != VisualMode.Default;
			
			if(debugSkyActive) {
				CustomSkyRenderer.instance.setDebugSky(true);
				mc.world.provider.setSkyRenderer(CustomSkyRenderer.instance);
			} else if(Environments.isNonDefault()) {
				CustomSkyRenderer.instance.setDebugSky(false);
				mc.world.provider.setSkyRenderer(CustomSkyRenderer.instance);
			} else {
				CustomSkyRenderer.instance.setDebugSky(false);
				mc.world.provider.setSkyRenderer(null);
			}
		}
		
		// handle currently active VisualMode
		if(mc.player != null) {
			RenderModeHelper.ENABLE(visMode);
		}
	}
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:33,代码来源:ClientRenderer.java

示例8: on_render_world_terrain_post

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
public void on_render_world_terrain_post(RenderTickEvent revt) {
	if(mc.ingameGUI != null && mc.world != null) {
		if(proxy.getInfoBar().canDisplayInfoBar(mc, proxy)) {
			proxy.getInfoBar().display(mc, mc.world, proxy);

			// XXX: Move this to its own IF
			proxy.getInvokeTracker().display(mc, proxy);
		}
	}
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:11,代码来源:ClientRenderer.java

示例9: onTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(RenderTickEvent event)
{
	//we want the END phase
	if (!event.phase.equals(Phase.END))return;
	if(Clock.doesRender(mcClient)){
		Clock.draw(mcClient);
	}

}
 
开发者ID:Xilef11,项目名称:MC-realTimeClock,代码行数:11,代码来源:RenderTickHandler.java

示例10: onTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(RenderTickEvent t) {
	GuiScreen screen = Minecraft.getMinecraft().currentScreen;
	if (screen instanceof GuiMainMenu) {
		screen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, StatCollector.translateToLocal("ias.loggedinas") + Minecraft.getMinecraft().getSession().getUsername()+".", screen.width / 2, screen.height / 4 + 48 + 72 + 12 + 22, 0xFFCC8888);
	}else if(screen instanceof GuiMultiplayer){
		if (Minecraft.getMinecraft().getSession().getToken().equals("0")) {
			screen.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, StatCollector.translateToLocal("ias.offlinemode"), screen.width / 2, 10, 16737380);
		}
	}
}
 
开发者ID:therealfarfetchd,项目名称:IngameAccountSwitcher,代码行数:12,代码来源:FMLEvents.java

示例11: onRender

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRender(RenderTickEvent evt) {
    if (evt.phase == Phase.END) {
        GlStateManager.color(1, 1, 1);
        GlStateManager.enableTexture2D();
        GlStateManager.disableLighting();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        if (mouseIndicators != null)
            mouseIndicators.render(evt.renderTickTime);

        if (keyboardIndicators != null)
            keyboardIndicators.render(evt.renderTickTime);
    }
}
 
开发者ID:boq,项目名称:ClicketyClack,代码行数:16,代码来源:OverlayRenderHandler.java

示例12: onRenderTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@Override
public boolean onRenderTick(RenderTickEvent evt) throws FileNotFoundException, IOException {
    int width = config.captureWidth.get();
    int height = config.captureHeight.get();
    
    FramebufferCapturer fbc = new FramebufferCapturer();
    FramebufferTiledWriter fbw = new FramebufferTiledWriter(file, fbc, width, height);
    fbw.write();
    
    return true;
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:12,代码来源:CaptureTiledTask.java

示例13: onRenderTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@Override
public boolean onRenderTick(RenderTickEvent evt) throws Exception {
    switch (frame) {
        // override viewport size (the following frame will be black)
        case 0:
            displayWidth = MC.displayWidth;
            displayHeight = MC.displayHeight;
            
            int width = config.captureWidth.get();
            int height = config.captureHeight.get();
            
            // resize viewport/framebuffer
            MC.resize(width, height);
            break;

        // capture screenshot and restore viewport size
        case 3:
            try {
                FramebufferCapturer fbc = new FramebufferCapturer();
                FramebufferWriter fbw = new FramebufferWriter(file, fbc);
                fbw.write();
            } finally {
                // restore viewport/framebuffer
                MC.resize(displayWidth, displayHeight);
            }
            break;
    }
    
    frame++;
    return frame > 3;
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:32,代码来源:CaptureTask.java

示例14: RenderTickEvent

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void RenderTickEvent(TickEvent.RenderTickEvent event)
{
    if (event.phase == TickEvent.Phase.START)
    {
        renderPartialTicks = event.renderTickTime;

        if (Minecraft.getMinecraft().player != null) DrawableApi.beginFrustum();
    }
    else if (event.phase == TickEvent.Phase.END)
    {
    }
}
 
开发者ID:TTTA2,项目名称:SkipSignGUI,代码行数:14,代码来源:SkipSignCore.java

示例15: onRenderTick

import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
	if (event.phase == Phase.START) {
		if (mc.thePlayer != null && ZSSPlayerSkills.get(mc.thePlayer) != null) {
			// TODO updateRenderer();
			ZSSPlayerSkills.get(mc.thePlayer).onRenderTick(event.renderTickTime);
			float swing = ZSSPlayerInfo.get(mc.thePlayer).armSwing;
			if (swing > 0.0F) {
				mc.thePlayer.swingProgress = swing;
				mc.thePlayer.prevSwingProgress = swing;
			}
		}
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:15,代码来源:TargetingTickHandler.java


注:本文中的net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。