本文整理汇总了Java中net.minecraft.client.gui.GuiGameOver类的典型用法代码示例。如果您正苦于以下问题:Java GuiGameOver类的具体用法?Java GuiGameOver怎么用?Java GuiGameOver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiGameOver类属于net.minecraft.client.gui包,在下文中一共展示了GuiGameOver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: guiInstance
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
static void guiInstance(GuiOpenEvent e) {
if (!(mc.currentScreen instanceof ScreenGUI)) {
if (mc.currentScreen != e.gui) {
if ((e.gui instanceof GuiIngameMenu) || ((e.gui instanceof GuiInventory) && (!OptionCore.DEFAULT_INVENTORY.getValue()))) {
final boolean inv = (e.gui instanceof GuiInventory);
if (mc.playerController.isInCreativeMode() && inv)
e.gui = new GuiContainerCreative(mc.thePlayer);
else {
e.gui = new IngameMenuGUI((inv ? (GuiInventory) mc.currentScreen : null));
}
}
if ((e.gui instanceof GuiGameOver) && (!OptionCore.DEFAULT_DEATH_SCREEN.getValue())) {
if (mc.ingameGUI instanceof IngameGUI) {
e.gui = new DeathScreen();
}
}
}
else e.setCanceled(true);
}
}
示例2: Ghost
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public Ghost() {
super("Ghost", 0xC0FFB1, ModuleCategory.MISCELLANEOUS);
listeners.add(new Listener<PlayerUpdate>() {
@Override
public void call(PlayerUpdate event) {
if (mc.currentScreen instanceof GuiGameOver) {
mc.currentScreen = null;
mc.setIngameFocus();
hasGhosted = true;
mc.thePlayer.setPlayerSPHealth(1);
}
}
});
}
示例3: onLivingUpdate
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
@SubscribeEvent
public void onLivingUpdate(LivingUpdateEvent event)
{
if (event.entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)event.entity;
ItemStack itemstack = player.getHeldItem();
if (player.ticksExisted % 2 == 0)
{
if (mc.getSoundHandler().isSoundPlaying(FNAFSoundHandler.deathStatic) && !(mc.currentScreen instanceof GuiGameOver))
{
mc.getSoundHandler().stopSound(FNAFSoundHandler.deathStatic);
}
}
}
}
示例4: onGuiOpen
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event)
{
// if (event.gui instanceof GuiMainMenu)
// {
// {
//
// }
// }
if (event.gui instanceof GuiGameOver)
{
GuiFNAFGameOver.ticksElapsed = 0;
mc.getSoundHandler().stopSounds();
if (!mc.getSoundHandler().isSoundPlaying(FNAFSoundHandler.deathStatic))
{
mc.getSoundHandler().playSound(FNAFSoundHandler.deathStatic);
}
}
}
示例5: onPlaySound
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
@SubscribeEvent
public void onPlaySound(PlaySoundEvent17 event)
{
if (mc.currentScreen instanceof GuiGameOver)
{
if (!event.name.equals("static"))
{
event.result = null;
}
}
// else if (mc.currentScreen instanceof GuiMonitor)
// {
// if (event.name.equals("gui.button.press"))
// {
// event.result = null;
// }
// }
}
示例6: onGuiOpen
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event)
{
GuiScreen gui = event.gui;
if (!Settings.autoRespawn)
{
return;
}
if (gui instanceof GuiGameOver && !hasClicked)
{
Minecraft mc = Minecraft.getMinecraft();
if (!mc.theWorld.getWorldInfo().isHardcoreModeEnabled())
{
hasClicked = true;
mc.thePlayer.respawnPlayer();
mc.displayGuiScreen((GuiScreen) null);
event.setCanceled(true);
}
}
else if (!(gui instanceof GuiGameOver) && hasClicked)
{
hasClicked = false;
}
}
示例7: onOpenGui
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
@SubscribeEvent
public void onOpenGui(GuiOpenEvent event) {
Minecraft mc = Minecraft.getMinecraft();
if (mc.player != null) {
if (event.getGui() instanceof GuiGameOver && isKnockedOut && !acceptedDeath) { // Minor hack: isKnockedOut is always set AFTER the game over screen pops up, so we can abuse that here
event.setGui(null);
} else if (isKnockedOut && event.getGui() instanceof GuiInventory) {
event.setGui(null);
}
}
}
示例8: setDimensionAndSpawnPlayer
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public void setDimensionAndSpawnPlayer(int dimension)
{
this.theWorld.setInitialSpawnLocation();
this.theWorld.removeAllEntities();
int i = 0;
String s = null;
if (this.thePlayer != null)
{
i = this.thePlayer.getEntityId();
this.theWorld.removeEntity(this.thePlayer);
s = this.thePlayer.getClientBrand();
}
this.renderViewEntity = null;
EntityPlayerSP entityplayersp = this.thePlayer;
this.thePlayer = this.playerController.func_178892_a(this.theWorld, this.thePlayer == null ? new StatFileWriter() : this.thePlayer.getStatFileWriter());
this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched());
this.thePlayer.dimension = dimension;
this.renderViewEntity = this.thePlayer;
this.thePlayer.preparePlayerToSpawn();
this.thePlayer.setClientBrand(s);
this.theWorld.spawnEntityInWorld(this.thePlayer);
this.playerController.flipPlayer(this.thePlayer);
this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
this.thePlayer.setEntityId(i);
this.playerController.setPlayerCapabilities(this.thePlayer);
this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug());
if (this.currentScreen instanceof GuiGameOver)
{
this.displayGuiScreen((GuiScreen)null);
}
}
示例9: setDimensionAndSpawnPlayer
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public void setDimensionAndSpawnPlayer(int dimension) {
this.theWorld.setInitialSpawnLocation();
this.theWorld.removeAllEntities();
int i = 0;
String s = null;
if (this.thePlayer != null) {
i = this.thePlayer.getEntityId();
this.theWorld.removeEntity(this.thePlayer);
s = this.thePlayer.getClientBrand();
}
this.renderViewEntity = null;
EntityPlayerSP entityplayersp = this.thePlayer;
this.thePlayer = this.playerController.func_178892_a(this.theWorld,
this.thePlayer == null ? new StatFileWriter() : this.thePlayer.getStatFileWriter());
this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched());
this.thePlayer.dimension = dimension;
this.renderViewEntity = this.thePlayer;
this.thePlayer.preparePlayerToSpawn();
this.thePlayer.setClientBrand(s);
this.theWorld.spawnEntityInWorld(this.thePlayer);
this.playerController.flipPlayer(this.thePlayer);
this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
this.thePlayer.setEntityId(i);
this.playerController.setPlayerCapabilities(this.thePlayer);
this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug());
if (this.currentScreen instanceof GuiGameOver) {
this.displayGuiScreen((GuiScreen) null);
}
}
示例10: handleCombatEvent
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public void handleCombatEvent(SPacketCombatEvent packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (packetIn.eventType == SPacketCombatEvent.Event.ENTITY_DIED)
{
Entity entity = this.clientWorldController.getEntityByID(packetIn.playerId);
if (entity == this.gameController.player)
{
this.gameController.displayGuiScreen(new GuiGameOver(packetIn.deathMessage));
}
}
}
示例11: setDimensionAndSpawnPlayer
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public void setDimensionAndSpawnPlayer(int dimension)
{
this.world.setInitialSpawnLocation();
this.world.removeAllEntities();
int i = 0;
String s = null;
if (this.player != null)
{
i = this.player.getEntityId();
this.world.removeEntity(this.player);
s = this.player.getServerBrand();
}
this.renderViewEntity = null;
EntityPlayerSP entityplayersp = this.player;
this.player = this.playerController.createClientPlayer(this.world, this.player == null ? new StatisticsManager() : this.player.getStatFileWriter());
this.player.getDataManager().setEntryValues(entityplayersp.getDataManager().getAll());
this.player.dimension = dimension;
this.renderViewEntity = this.player;
this.player.preparePlayerToSpawn();
this.player.setServerBrand(s);
this.world.spawnEntityInWorld(this.player);
this.playerController.flipPlayer(this.player);
this.player.movementInput = new MovementInputFromOptions(this.gameSettings);
this.player.setEntityId(i);
this.playerController.setPlayerCapabilities(this.player);
this.player.setReducedDebug(entityplayersp.hasReducedDebug());
if (this.currentScreen instanceof GuiGameOver)
{
this.displayGuiScreen((GuiScreen)null);
}
}
示例12: handleCombatEvent
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public void handleCombatEvent(SPacketCombatEvent packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (packetIn.eventType == SPacketCombatEvent.Event.ENTITY_DIED)
{
Entity entity = this.clientWorldController.getEntityByID(packetIn.playerId);
if (entity == this.gameController.thePlayer)
{
this.gameController.displayGuiScreen(new GuiGameOver(packetIn.deathMessage));
}
}
}
示例13: setDimensionAndSpawnPlayer
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public void setDimensionAndSpawnPlayer(int dimension)
{
this.theWorld.setInitialSpawnLocation();
this.theWorld.removeAllEntities();
int i = 0;
String s = null;
if (this.thePlayer != null)
{
i = this.thePlayer.getEntityId();
this.theWorld.removeEntity(this.thePlayer);
s = this.thePlayer.getServerBrand();
}
this.renderViewEntity = null;
EntityPlayerSP entityplayersp = this.thePlayer;
this.thePlayer = this.playerController.createClientPlayer(this.theWorld, this.thePlayer == null ? new StatisticsManager() : this.thePlayer.getStatFileWriter());
this.thePlayer.getDataManager().setEntryValues(entityplayersp.getDataManager().getAll());
this.thePlayer.dimension = dimension;
this.renderViewEntity = this.thePlayer;
this.thePlayer.preparePlayerToSpawn();
this.thePlayer.setServerBrand(s);
this.theWorld.spawnEntityInWorld(this.thePlayer);
this.playerController.flipPlayer(this.thePlayer);
this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
this.thePlayer.setEntityId(i);
this.playerController.setPlayerCapabilities(this.thePlayer);
this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug());
if (this.currentScreen instanceof GuiGameOver)
{
this.displayGuiScreen((GuiScreen)null);
}
}
示例14: onPlayerDeathImage
import net.minecraft.client.gui.GuiGameOver; //导入依赖的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();
}
}
示例15: DeathScreen
import net.minecraft.client.gui.GuiGameOver; //导入依赖的package包/类
public DeathScreen(GuiGameOver guiGamOver) {
super();
gameOver = guiGamOver;
oldCursorStatus = CURSOR_STATUS;
CURSOR_STATUS = CursorStatus.HIDDEN;
}