net.minecraft.client.gui.GuiGameOver Java Examples

The following examples show how to use net.minecraft.client.gui.GuiGameOver. 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: GodModeModule.java    From seppuku with GNU General Public License v3.0 5 votes vote down vote up
@Listener
public void onUpdate(EventPlayerUpdate event) {
    if (event.getStage() == EventStageable.EventStage.PRE) {
        final Minecraft mc = Minecraft.getMinecraft();

        if (this.mode.getValue() == Mode.LOCK) {
            if (mc.currentScreen instanceof GuiGameOver) {
                mc.displayGuiScreen(null);
            }
            mc.player.setHealth(20.0f);
            mc.player.getFoodStats().setFoodLevel(20);
            mc.player.isDead = false;
        }
    }
}
 
Example #2
Source File: RespawnModule.java    From seppuku with GNU General Public License v3.0 4 votes vote down vote up
@Listener
public void displayGuiScreen(EventDisplayGui event) {
    if(event.getScreen() != null && event.getScreen() instanceof GuiGameOver) {
        Minecraft.getMinecraft().player.respawnPlayer();
    }
}
 
Example #3
Source File: GodModeModule.java    From seppuku with GNU General Public License v3.0 4 votes vote down vote up
@Listener
public void displayGui(EventDisplayGui event) {
    if (event.getScreen() != null && event.getScreen() instanceof GuiGameOver && this.mode.getValue() == Mode.LOCK) {
        event.setCanceled(true);
    }
}
 
Example #4
Source File: Mw.java    From mapwriter with MIT License 4 votes vote down vote up
public void onTick() {
	this.load();
	if (this.ready && (this.mc.thePlayer != null)) {
		
		this.updatePlayer();
		
		if (this.undergroundMode && ((this.tickCounter % 30) == 0)) {
			this.undergroundMapTexture.update();
		}
		
		// check if the game over screen is being displayed and if so 
		// (thanks to Chrixian for this method of checking when the player is dead)
		if (this.mc.currentScreen instanceof GuiGameOver) {
			if (!this.onPlayerDeathAlreadyFired) {
				this.onPlayerDeath();
				this.onPlayerDeathAlreadyFired = true;
			}
		} else if (!(this.mc.currentScreen instanceof MwGui)) {
			// if the player is not dead
			this.onPlayerDeathAlreadyFired = false;
			// if in game (no gui screen) center the minimap on the player and render it.
		    this.miniMap.view.setViewCentreScaled(this.playerX, this.playerZ, this.playerDimension);
			this.miniMap.drawCurrentMap();
		}
		
		// process background tasks
		int maxTasks = 50;
		while (!this.executor.processTaskQueue() && (maxTasks > 0)) {
			maxTasks--;
		}
		
		this.chunkManager.onTick();
		
		// update GL texture of mapTexture if updated
		this.mapTexture.processTextureUpdates();
		
		// let the renderEngine know we have changed the bound texture.
    	//this.mc.renderEngine.resetBoundTexture();
		
    	//if (this.tickCounter % 100 == 0) {
    	//	MwUtil.log("tick %d", this.tickCounter);
    	//}
    	this.playerTrail.onTick();
    	
		this.tickCounter++;
	}
}