From cb30b11d647ce32de40446bef9f80d24dc3ebfa4 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Fri, 1 Nov 2013 11:38:33 -0400 Subject: [PATCH] Killed the rest of the references --- common/mekanism/client/ClientProxy.java | 6 - common/mekanism/client/gui/GuiStopwatch.java | 104 ----------------- common/mekanism/client/gui/GuiWeatherOrb.java | 105 ------------------ common/mekanism/common/Mekanism.java | 4 - .../mekanism/common/network/PacketTime.java | 41 ------- .../common/network/PacketWeather.java | 73 ------------ .../mekanism/common/util/MekanismUtils.java | 12 -- 7 files changed, 345 deletions(-) delete mode 100644 common/mekanism/client/gui/GuiStopwatch.java delete mode 100644 common/mekanism/client/gui/GuiWeatherOrb.java delete mode 100644 common/mekanism/common/network/PacketTime.java delete mode 100644 common/mekanism/common/network/PacketWeather.java diff --git a/common/mekanism/client/ClientProxy.java b/common/mekanism/client/ClientProxy.java index 2b7a18df6..6364d8cda 100644 --- a/common/mekanism/client/ClientProxy.java +++ b/common/mekanism/client/ClientProxy.java @@ -29,9 +29,7 @@ import mekanism.client.gui.GuiRobitInventory; import mekanism.client.gui.GuiRobitMain; import mekanism.client.gui.GuiRobitRepair; import mekanism.client.gui.GuiRobitSmelting; -import mekanism.client.gui.GuiStopwatch; import mekanism.client.gui.GuiTeleporter; -import mekanism.client.gui.GuiWeatherOrb; import mekanism.client.render.MekanismRenderer; import mekanism.client.render.RenderTickHandler; import mekanism.client.render.block.BasicRenderingHandler; @@ -276,12 +274,8 @@ public class ClientProxy extends CommonProxy switch(ID) { - case 0: - return new GuiStopwatch(player); case 1: return new GuiCredits(); - case 2: - return new GuiWeatherOrb(player); case 3: return new GuiEnrichmentChamber(player.inventory, (TileEntityElectricMachine)tileEntity); case 4: diff --git a/common/mekanism/client/gui/GuiStopwatch.java b/common/mekanism/client/gui/GuiStopwatch.java deleted file mode 100644 index 8398fb852..000000000 --- a/common/mekanism/client/gui/GuiStopwatch.java +++ /dev/null @@ -1,104 +0,0 @@ -package mekanism.client.gui; - -import mekanism.common.PacketHandler; -import mekanism.common.PacketHandler.Transmission; -import mekanism.common.network.PacketTime; -import mekanism.common.util.MekanismUtils; -import mekanism.common.util.MekanismUtils.ResourceType; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiStopwatch extends GuiScreen -{ - private static EntityPlayer player; - - public GuiStopwatch(EntityPlayer entityplayer) - { - player = entityplayer; - } - - @Override - public void initGui() - { - buttonList.clear(); - buttonList.add(new GuiButton(0, width / 2 - 80, height / 2 - 65, 50, 20, "Sunrise")); - buttonList.add(new GuiButton(1, width / 2 - 80, height / 2 - 35, 50, 20, "Noon")); - buttonList.add(new GuiButton(2, width / 2 + 5, height / 2 - 65, 50, 20, "Sunset")); - buttonList.add(new GuiButton(3, width / 2 + 5, height / 2 - 35, 50, 20, "Midnight")); - buttonList.add(new GuiButton(4, width / 2 - 94, height / 2 + 30, 80, 20, "Credits")); - buttonList.add(new GuiButton(5, width / 2 - 10, height / 2 + 30, 80, 20, "Close")); - } - - @Override - public void drawScreen(int i, int j, float f) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiStopwatch.png")); - drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166); - drawString(fontRenderer, "Steve's Stopwatch", width / 2 - 60, height / 2 - 95, 0xffffff); - super.drawScreen(i, j, f); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - - @Override - public void keyTyped(char c, int i) - { - if(i == 1) - { - mc.displayGuiScreen(null); - } - } - - @Override - public boolean doesGuiPauseGame() - { - return false; - } - - @Override - public void actionPerformed(GuiButton guibutton) - { - if(guibutton.id == 0) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(0)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 1) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(6)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 2) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(12)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 3) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(18)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 4) - { - mc.displayGuiScreen(new GuiCredits()); - } - if(guibutton.id == 5) - { - mc.displayGuiScreen(null); - } - } -} diff --git a/common/mekanism/client/gui/GuiWeatherOrb.java b/common/mekanism/client/gui/GuiWeatherOrb.java deleted file mode 100644 index 0f340e170..000000000 --- a/common/mekanism/client/gui/GuiWeatherOrb.java +++ /dev/null @@ -1,105 +0,0 @@ -package mekanism.client.gui; - -import mekanism.common.PacketHandler; -import mekanism.common.PacketHandler.Transmission; -import mekanism.common.network.PacketWeather; -import mekanism.common.network.PacketWeather.WeatherType; -import mekanism.common.util.MekanismUtils; -import mekanism.common.util.MekanismUtils.ResourceType; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiWeatherOrb extends GuiScreen -{ - private static EntityPlayer player; - - public GuiWeatherOrb(EntityPlayer entityplayer) - { - player = entityplayer; - } - - @Override - public void initGui() - { - buttonList.clear(); - buttonList.add(new GuiButton(0, width / 2 - 80, height / 2 - 65, 50, 20, "Clear")); - buttonList.add(new GuiButton(1, width / 2 - 80, height / 2 - 35, 50, 20, "Storm")); - buttonList.add(new GuiButton(2, width / 2 + 5, height / 2 - 65, 50, 20, "Haze")); - buttonList.add(new GuiButton(3, width / 2 + 5, height / 2 - 35, 50, 20, "Rain")); - buttonList.add(new GuiButton(4, width / 2 - 94, height / 2 + 30, 80, 20, "Credits")); - buttonList.add(new GuiButton(5, width / 2 - 10, height / 2 + 30, 80, 20, "Close")); - } - - @Override - public void drawScreen(int i, int j, float f) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiWeatherOrb.png")); - drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166); - drawString(fontRenderer, "Weather Orb", width / 2 - 45, height / 2 - 95, 0xffffff); - super.drawScreen(i, j, f); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - - @Override - public void keyTyped(char c, int i) - { - if (i == 1) - { - mc.displayGuiScreen(null); - } - } - - @Override - public boolean doesGuiPauseGame() - { - return false; - } - - @Override - public void actionPerformed(GuiButton guibutton) - { - if(guibutton.id == 0) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketWeather().setParams(WeatherType.CLEAR)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 1) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketWeather().setParams(WeatherType.STORM)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 2) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketWeather().setParams(WeatherType.HAZE)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 3) - { - MekanismUtils.doFakeEntityExplosion(player); - PacketHandler.sendPacket(Transmission.SERVER, new PacketWeather().setParams(WeatherType.RAIN)); - mc.displayGuiScreen(null); - } - if(guibutton.id == 4) - { - mc.displayGuiScreen(new GuiCredits()); - } - if(guibutton.id == 5) - { - mc.displayGuiScreen(null); - } - } -} diff --git a/common/mekanism/common/Mekanism.java b/common/mekanism/common/Mekanism.java index d738aac10..1dc63da28 100644 --- a/common/mekanism/common/Mekanism.java +++ b/common/mekanism/common/Mekanism.java @@ -68,11 +68,9 @@ import mekanism.common.network.PacketRobit; import mekanism.common.network.PacketSimpleGui; import mekanism.common.network.PacketStatusUpdate; import mekanism.common.network.PacketTileEntity; -import mekanism.common.network.PacketTime; import mekanism.common.network.PacketTransmitterTransferUpdate; import mekanism.common.network.PacketTransmitterTransferUpdate.TransmitterTransferType; import mekanism.common.network.PacketWalkieTalkieState; -import mekanism.common.network.PacketWeather; import mekanism.common.tileentity.TileEntityBoundingBlock; import mekanism.common.tileentity.TileEntityEnergyCube; import mekanism.common.tileentity.TileEntityGasTank; @@ -1115,8 +1113,6 @@ public class Mekanism //Packet registrations PacketHandler.registerPacket(PacketRobit.class); PacketHandler.registerPacket(PacketTransmitterTransferUpdate.class); - PacketHandler.registerPacket(PacketTime.class); - PacketHandler.registerPacket(PacketWeather.class); PacketHandler.registerPacket(PacketElectricChest.class); PacketHandler.registerPacket(PacketElectricBowState.class); PacketHandler.registerPacket(PacketConfiguratorState.class); diff --git a/common/mekanism/common/network/PacketTime.java b/common/mekanism/common/network/PacketTime.java deleted file mode 100644 index 7a7bf292b..000000000 --- a/common/mekanism/common/network/PacketTime.java +++ /dev/null @@ -1,41 +0,0 @@ -package mekanism.common.network; - -import java.io.DataOutputStream; - -import mekanism.common.util.MekanismUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -import com.google.common.io.ByteArrayDataInput; - -public class PacketTime implements IMekanismPacket -{ - public int hourToSet; - - @Override - public String getName() - { - return "Time"; - } - - @Override - public IMekanismPacket setParams(Object... data) - { - hourToSet = (Integer)data[0]; - - return this; - } - - @Override - public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception - { - player.getCurrentEquippedItem().damageItem(4999, player); - MekanismUtils.setHourForward(world, dataStream.readInt()); - } - - @Override - public void write(DataOutputStream dataStream) throws Exception - { - dataStream.writeInt(hourToSet); - } -} diff --git a/common/mekanism/common/network/PacketWeather.java b/common/mekanism/common/network/PacketWeather.java deleted file mode 100644 index 7e4a9739c..000000000 --- a/common/mekanism/common/network/PacketWeather.java +++ /dev/null @@ -1,73 +0,0 @@ -package mekanism.common.network; - -import java.io.DataOutputStream; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -import com.google.common.io.ByteArrayDataInput; - -public class PacketWeather implements IMekanismPacket -{ - public WeatherType activeType; - - @Override - public String getName() - { - return "Weather"; - } - - @Override - public IMekanismPacket setParams(Object... data) - { - activeType = (WeatherType)data[0]; - - return this; - } - - @Override - public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception - { - player.getCurrentEquippedItem().damageItem(4999, player); - int weatherType = dataStream.readInt(); - - switch(weatherType) - { - case 0: - world.getWorldInfo().setRaining(false); - world.getWorldInfo().setThundering(false); - break; - case 1: - world.getWorldInfo().setThundering(true); - break; - case 2: - world.getWorldInfo().setRaining(true); - world.getWorldInfo().setThundering(true); - break; - case 3: - world.getWorldInfo().setRaining(true); - break; - } - } - - @Override - public void write(DataOutputStream dataStream) throws Exception - { - dataStream.writeInt(activeType.ordinal()); - } - - public static enum WeatherType - { - /** Clears the world of all weather effects, including rain, lightning, and clouds. */ - CLEAR, - - /** Sets the world's weather to thunder. This may or may not include rain. */ - STORM, - - /** Sets the world's weather to both thunder AND rain. */ - HAZE, - - /** Sets the world's weather to rain. */ - RAIN - } -} diff --git a/common/mekanism/common/util/MekanismUtils.java b/common/mekanism/common/util/MekanismUtils.java index 0715ddc85..c2a9beb0c 100644 --- a/common/mekanism/common/util/MekanismUtils.java +++ b/common/mekanism/common/util/MekanismUtils.java @@ -298,18 +298,6 @@ public final class MekanismUtils } } - /** - * Sets the defined world's time to the defined time. - * @param world - world to set time - * @param paramInt - hour to set time to - */ - public static void setHourForward(World world, int paramInt) - { - long l1 = world.getWorldTime() / 24000L * 24000L; - long l2 = l1 + 24000L + paramInt * 1000; - world.setWorldTime(l2); - } - /** * Creates a fake explosion at the declared player, with only sounds and effects. No damage is caused to either blocks or the player. * @param entityplayer - player to explode