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


Java ScreenShotHelper类代码示例

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


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

示例1: dispatchKeypresses

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
public void dispatchKeypresses()
{
    int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();

    if (i != 0 && !Keyboard.isRepeatEvent())
    {
        if (!(this.currentScreen instanceof GuiControls) || ((GuiControls)this.currentScreen).time <= getSystemTime() - 20L)
        {
            if (Keyboard.getEventKeyState())
            {
                if (i == this.gameSettings.keyBindFullscreen.getKeyCode())
                {
                    this.toggleFullscreen();
                }
                else if (i == this.gameSettings.keyBindScreenshot.getKeyCode())
                {
                    this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc));
                }
            }
        }
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:23,代码来源:Minecraft.java

示例2: dispatchKeypresses

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
public void dispatchKeypresses()
{
    int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();

    if (i != 0 && !Keyboard.isRepeatEvent())
    {
        if (!(this.currentScreen instanceof GuiControls) || ((GuiControls)this.currentScreen).time <= getSystemTime() - 20L)
        {
            if (Keyboard.getEventKeyState())
            {
                if (this.gameSettings.keyBindFullscreen.isActiveAndMatches(i))
                {
                    this.toggleFullscreen();
                }
                else if (this.gameSettings.keyBindScreenshot.isActiveAndMatches(i))
                {
                    this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc));
                }
            }
            else if (this.currentScreen instanceof GuiControls) ((GuiControls)this.currentScreen).buttonId = null;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:Minecraft.java

示例3: screenshotListener

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
/**
 * checks if keys are down
 */
private void screenshotListener()
{
    if (this.gameSettings.keyBindScreenshot.isPressed())
    {
        if (!this.isTakingScreenshot)
        {
            this.isTakingScreenshot = true;
            this.ingameGUI.getChatGUI().func_146227_a(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.mcFramebuffer));
        }
    }
    else
    {
        this.isTakingScreenshot = false;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:19,代码来源:Minecraft.java

示例4: screenshotListener

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
/**
 * checks if keys are down
 */
private void screenshotListener()
{
    if (Keyboard.isKeyDown(60))
    {
        if (!this.isTakingScreenshot)
        {
            this.isTakingScreenshot = true;
            this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight));
        }
    }
    else
    {
        this.isTakingScreenshot = false;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:19,代码来源:Minecraft.java

示例5: createWorldIcon

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
private void createWorldIcon()
{
    if (this.mc.renderGlobal.getRenderedChunks() > 10 && this.mc.renderGlobal.hasNoChunkUpdates() && !this.mc.getIntegratedServer().isWorldIconSet())
    {
        BufferedImage bufferedimage = ScreenShotHelper.createScreenshot(this.mc.displayWidth, this.mc.displayHeight, this.mc.getFramebuffer());
        int i = bufferedimage.getWidth();
        int j = bufferedimage.getHeight();
        int k = 0;
        int l = 0;

        if (i > j)
        {
            k = (i - j) / 2;
            i = j;
        }
        else
        {
            l = (j - i) / 2;
        }

        try
        {
            BufferedImage bufferedimage1 = new BufferedImage(64, 64, 1);
            Graphics graphics = bufferedimage1.createGraphics();
            graphics.drawImage(bufferedimage, 0, 0, 64, 64, k, l, k + i, l + i, (ImageObserver)null);
            graphics.dispose();
            ImageIO.write(bufferedimage1, "png", (File)this.mc.getIntegratedServer().getWorldIconFile());
        }
        catch (IOException ioexception)
        {
            LOGGER.warn((String)"Couldn\'t save auto screenshot", (Throwable)ioexception);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:35,代码来源:EntityRenderer.java

示例6: tryGettingScreenshot

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
/**
 * Take screenshot
 * Apparently, it's not possible to call ScreenShotHelper.saveScreenshot() from the NetworkManager thread, so I'm using a flag (mShouldTakeScreenShot)
 */
public void tryGettingScreenshot() {
	if (mShouldTakeScreenShot) {
		mShouldTakeScreenShot = false;
		try {
			ITextComponent chatComponent = ScreenShotHelper.saveScreenshot(mc.mcDataDir.getCanonicalFile(), mc.displayWidth, mc.displayHeight, mc.getFramebuffer());
			String unformattedText = chatComponent.getUnformattedText();
			int size = unformattedText.split(" ").length;
			String fileName = unformattedText.split(" ")[size - 1];
			mManager.sendScreenShot(fileName, mWorld.getSeed());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:RemotecraftProject,项目名称:RemotecraftMod,代码行数:19,代码来源:Core.java

示例7: onPlayerDeathImage

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPlayerDeathImage(GuiOpenEvent e)
{
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;

    if (!(e.getGui() instanceof GuiGameOver)
            || !Config.demiseImage
            || player == null
            || player.getHealth() <= 0F)
        return;

    // Getting discord and minecraft user
    try
    {
        User me = DiscordCE.client.getUserById(DiscordCE.client.getSelfInfo().getId());
        Minecraft mc = Minecraft.getMinecraft();
        ITextComponent t = ScreenShotHelper.saveScreenshot(mc.mcDataDir,
                mc.displayWidth,
                mc.displayHeight,
                mc.getFramebuffer());
        String fileName = new JSONObject(TextComponentBase.Serializer.componentToJson(t)).getJSONArray("with")
                .getJSONObject(0).getJSONObject("clickEvent").getString("value");
        File file = new File(fileName);
        TextChannel c = DiscordCE.client.getTextChannelById(Preferences.i.usingChannel);

        // Doing checks
        if (c == null || !c.checkPermission(me, Permission.MESSAGE_ATTACH_FILES))
            return;

        //Sending file
        c.sendFileAsync(file, null, m -> file.delete());
    }

    catch (Exception e1)
    {
        e1.printStackTrace();
    }
}
 
开发者ID:duke605,项目名称:DiscordCE,代码行数:40,代码来源:MinecraftEventHandler.java

示例8: takeScreenshot

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
/**
 * Takes a screenshot of the player's view (the same as pressing F3), and sends the player a chat notification.
 */
@SideOnly(Side.CLIENT)
public static void takeScreenshot() {
    if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
        Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(Minecraft.getMinecraft().mcDataDir, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight, Minecraft.getMinecraft().getFramebuffer()));    
    }
}
 
开发者ID:Geforce132,项目名称:AllPI,代码行数:10,代码来源:ClientUtils.java

示例9: func_71365_K

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
private void func_71365_K() {
   if(Keyboard.isKeyDown(60)) {
      if(!this.field_71414_F) {
         this.field_71414_F = true;
         this.field_71456_v.func_73827_b().func_73765_a(ScreenShotHelper.func_74291_a(this.field_71412_D, this.field_71443_c, this.field_71440_d));
      }
   } else {
      this.field_71414_F = false;
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:12,代码来源:Minecraft.java

示例10: getScreenshot

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static BufferedImage getScreenshot() {
	BufferedImage image = ScreenShotHelper.createScreenshot(Minecraft.getMinecraft().displayWidth,
			Minecraft.getMinecraft().displayHeight, Minecraft.getMinecraft().getFramebuffer());
	return image;
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:7,代码来源:PictureFactory.java

示例11: getFormattingScreenshot

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static BufferedImage getFormattingScreenshot() {
	BufferedImage image = ScreenShotHelper.createScreenshot(Minecraft.getMinecraft().displayWidth,
			Minecraft.getMinecraft().displayHeight, Minecraft.getMinecraft().getFramebuffer());
	return FormattingPicture(image);
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:7,代码来源:PictureFactory.java

示例12: dispatchKeypresses

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
public void dispatchKeypresses() {
	int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey();

	if (i != 0 && !Keyboard.isRepeatEvent()) {
		if (!(this.currentScreen instanceof GuiControls)
				|| ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) {
			if (Keyboard.getEventKeyState()) {
				if (i == this.gameSettings.keyBindStreamStartStop.getKeyCode()) {
					if (this.getTwitchStream().isBroadcasting()) {
						this.getTwitchStream().stopBroadcasting();
					} else if (this.getTwitchStream().isReadyToBroadcast()) {
						this.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
							public void confirmClicked(boolean result, int id) {
								if (result) {
									Minecraft.this.getTwitchStream().func_152930_t();
								}

								Minecraft.this.displayGuiScreen((GuiScreen) null);
							}
						}, I18n.format("stream.confirm_start", new Object[0]), "", 0));
					} else if (this.getTwitchStream().func_152928_D() && this.getTwitchStream().func_152936_l()) {
						if (this.theWorld != null) {
							this.ingameGUI.getChatGUI()
									.printChatMessage(new ChatComponentText("Not ready to start streaming yet!"));
						}
					} else {
						GuiStreamUnavailable.func_152321_a(this.currentScreen);
					}
				} else if (i == this.gameSettings.keyBindStreamPauseUnpause.getKeyCode()) {
					if (this.getTwitchStream().isBroadcasting()) {
						if (this.getTwitchStream().isPaused()) {
							this.getTwitchStream().unpause();
						} else {
							this.getTwitchStream().pause();
						}
					}
				} else if (i == this.gameSettings.keyBindStreamCommercials.getKeyCode()) {
					if (this.getTwitchStream().isBroadcasting()) {
						this.getTwitchStream().requestCommercial();
					}
				} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
					this.stream.muteMicrophone(true);
				} else if (i == this.gameSettings.keyBindFullscreen.getKeyCode()) {
					this.toggleFullscreen();
				} else if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) {
					this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir,
							this.displayWidth, this.displayHeight, this.framebufferMc));
				}
			} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
				this.stream.muteMicrophone(false);
			}
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:55,代码来源:Minecraft.java

示例13: takeScreenShot

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
public static void takeScreenShot(String id, EntityPlayer player) {
    BufferedImage image = ScreenShotHelper.createScreenshot(width, height, Minecraft.getMinecraft().getFramebuffer());
    PacketUtill.INSTANCE.sendToServer(new PacketSaveSS(resize(image, width, height), id));
}
 
开发者ID:modmuss50,项目名称:TechnicalDimensions,代码行数:5,代码来源:ScreenShotUitls.java

示例14: takeScreenshot

import net.minecraft.util.ScreenShotHelper; //导入依赖的package包/类
/**
 * Takes a screenshot, and sends the player a notification. <p>
 *
 * Only works on the CLIENT side.
 */
@SideOnly(Side.CLIENT)
public static void takeScreenshot() {
	if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
		Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(Minecraft.getMinecraft().mcDataDir, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight, Minecraft.getMinecraft().getFramebuffer()));
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:11,代码来源:ClientUtils.java


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