Backported "Ascending to the Aether" and "Descending to the Aether" messages.
This commit is contained in:
parent
5f0dbbd9da
commit
9c9efc46b4
|
@ -2,8 +2,11 @@ package com.legacy.aether.client;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.legacy.aether.client.gui.GuiEnterAether;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiDownloadTerrain;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiContainerCreative;
|
||||
|
@ -16,11 +19,8 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
|
||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel;
|
||||
|
||||
import com.legacy.aether.AetherConfig;
|
||||
|
@ -42,6 +42,8 @@ import cpw.mods.fml.common.gameevent.TickEvent;
|
|||
|
||||
public class AetherClientEvents {
|
||||
|
||||
private static boolean wasInAether = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
@ -75,6 +77,31 @@ public class AetherClientEvents {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOpenGui(GuiOpenEvent event)
|
||||
{
|
||||
Minecraft mc = FMLClientHandler.instance().getClient();
|
||||
|
||||
if (mc.thePlayer != null && event.gui instanceof GuiDownloadTerrain)
|
||||
{
|
||||
GuiEnterAether enterAether = new GuiEnterAether(true);
|
||||
GuiEnterAether exitAether = new GuiEnterAether(false);
|
||||
|
||||
if (mc.thePlayer.dimension == AetherConfig.getAetherDimensionID())
|
||||
{
|
||||
event.gui = enterAether;
|
||||
wasInAether = true;
|
||||
}
|
||||
|
||||
else if (wasInAether)
|
||||
{
|
||||
event.gui = exitAether;
|
||||
wasInAether = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void sendPickupPacket(Minecraft mc) {
|
||||
if (mc.objectMouseOver != null) {
|
||||
if (!this.onPickEntity(mc.objectMouseOver, mc.thePlayer, mc.theWorld)) {
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package com.legacy.aether.client.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
public class GuiEnterAether extends GuiScreen
|
||||
{
|
||||
public boolean aether;
|
||||
|
||||
public GuiEnterAether(boolean dimension)
|
||||
{
|
||||
aether = dimension;
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.drawBackground(0);
|
||||
|
||||
if (aether)
|
||||
{
|
||||
this.drawCenteredString(this.fontRendererObj, I18n.format("gui.loading.enteraether"), this.width / 2, this.height / 2 - 45, 16777215);
|
||||
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 25, 16777215);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawCenteredString(this.fontRendererObj, I18n.format("gui.loading.exitaether"), this.width / 2, this.height / 2 - 45, 16777215);
|
||||
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 25, 16777215);
|
||||
}
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -391,5 +391,8 @@ subtitles.aeboss.sun_spirit.shoot=Sun Spirit shoots
|
|||
# Death messages
|
||||
death.attack.inebriation=%1$s was inebriated by Cockatrice
|
||||
|
||||
# Chat messages
|
||||
gui.sun_altar.message=The sun spirit has no power over this realm.
|
||||
# Gui messages
|
||||
gui.sun_altar.message=The sun spirit has no power over this realm.
|
||||
|
||||
gui.loading.enteraether=Ascending to the Aether
|
||||
gui.loading.exitaether=Descending from the Aether
|
Loading…
Reference in a new issue