1
0
mirror of https://github.com/chylex/Hardcore-Ender-Expansion.git synced 2025-04-14 05:15:42 +02:00

Add a config to pause the game when Compendium is open

This commit is contained in:
chylex 2015-11-02 02:37:05 +01:00
parent d25357b44c
commit d4b2dd1719
3 changed files with 8 additions and 1 deletions
src/main
java/chylex/hee
resources/META-INF

View File

@ -7,6 +7,7 @@ import net.minecraftforge.common.config.Property;
import chylex.hee.HardcoreEnderExpansion;
import chylex.hee.api.HeeIMC;
import chylex.hee.block.BlockEnderGoo;
import chylex.hee.gui.GuiEnderCompendium;
import chylex.hee.mechanics.misc.StardustDecomposition;
import chylex.hee.mechanics.orb.OrbAcquirableItems;
import chylex.hee.proxy.ModClientProxy;
@ -76,6 +77,7 @@ public final class ConfigHandler{
ModClientProxy.loadEnderbacon(getInt("hardcoreEnderbaconMode", 0, "0 = enabled on April Fools, 1 = always enabled, 2 = never enabled.").setShowInGui(false).getInt());
MusicManager.enableCustomMusic = getBool("enableMusic", true, "Custom music playing in the End dimension and custom Music Discs.").setRequiresMcRestart(true).getBoolean();
MusicManager.removeVanillaDelay = getBool("removeVanillaDelay", false, "Removes long delays between vanilla music tracks.").setRequiresMcRestart(true).getBoolean();
GuiEnderCompendium.pausesGame = getBoolValue("compendiumPausesGame", true, "If enabled, in singleplayer the Ender Compendium pauses the game when open.");
firstTimeClient = false;
}

View File

@ -40,6 +40,8 @@ public class GuiEnderCompendium extends GuiScreen{
public static final ResourceLocation texFragments = new ResourceLocation("hardcoreenderexpansion:textures/gui/ender_compendium_fragments.png");
public static final ItemStack knowledgeFragmentIS = new ItemStack(ItemList.knowledge_note);
public static boolean pausesGame;
private final GuiEndPortalRenderer portalRenderer;
private AnimatedFloat portalSpeed;
@ -205,6 +207,8 @@ public class GuiEnderCompendium extends GuiScreen{
@Override
public void drawScreen(int mouseX, int mouseY, float partialTickTime){
partialTickTime = Minecraft.getMinecraft().timer.elapsedPartialTicks; // if doesGuiPauseGame() returns true, Minecraft freezes renderPartialTicks
drawDefaultBackground();
GL11.glDepthFunc(GL11.GL_GEQUAL);
GL11.glPushMatrix();
@ -317,7 +321,7 @@ public class GuiEnderCompendium extends GuiScreen{
@Override
public boolean doesGuiPauseGame(){
return false;
return pausesGame;
}
/**

View File

@ -18,6 +18,7 @@ public net.minecraft.world.gen.ChunkProviderEnd field_73204_i # endRNG
public-f net.minecraft.world.biome.BiomeGenBase field_76779_k # sky
public net.minecraft.world.World field_73020_y # chunkProvider
public net.minecraft.client.Minecraft field_71428_T # timer
public net.minecraft.client.Minecraft field_147126_aw # mcMusicTicker
public net.minecraft.client.gui.inventory.GuiContainer field_146999_f # xSize
public net.minecraft.client.gui.inventory.GuiContainer field_147000_g # ySize