本文整理汇总了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);
}
}
}
示例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));
}
示例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;
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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)
{
}
}
示例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;
}
}
}
}