*Moved all resources to a unique package.
*Added javadocs for TabProxy.
*Boosted energy generation for Heat Generator.
*Removed texture preloads for animated FX.
*Made SoundHandler tick all sounds independently with an ArrayList.
*Fixed credits GUI pausing game.
*Added mekanism version, OS name and OS version to server data.
This commit is contained in:
Aidan Brady committed 2012-11-07 15:01:46 -05:00
1 parent 873ae2f5cf
commit f413018df4
61 files changed
+80 -46

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -14,6 +14,6 @@ public class ItemMachineUpgrade extends Item
public String getTextureFile()
{
return "/textures/items.png";
return "/resources/mekanism/textures/items.png";
}
}
+12
View File
@@ -2,10 +2,22 @@ package mekanism.api;
import net.minecraft.src.*;
/**
* Class used to add items or blocks to the Mekanism creative tab.
* @author AidanBrady
*
*/
public final class TabProxy
{
/** The 'Mekanism' class where the tab instance is stored. */
public static Class Mekanism;
/**
* Attempts to get the Mekanism creative tab instance from the 'Mekanism' class. Will return
* the tab if the mod is loaded, but otherwise will return null. Be sure you check it isn't
* null before you use it!
* @return mekanism creative tab if can, otherwise null
*/
public static CreativeTabs tabMekanism()
{
try {
@@ -200,7 +200,7 @@ public class BlockGenerator extends BlockContainer
@Override
public String getTextureFile()
{
return "/textures/terrain.png";
return "/resources/mekanism/textures/terrain.png";
}
@Override
+1 -1
View File
@@ -342,7 +342,7 @@ public class BlockMachine extends BlockContainer
@Override
public String getTextureFile()
{
return "/textures/terrain.png";
return "/resources/mekanism/textures/terrain.png";
}
@Override
+1 -1
View File
@@ -164,6 +164,6 @@ public class BlockMulti extends Block
@Override
public String getTextureFile()
{
return "/textures/terrain.png";
return "/resources/mekanism/textures/terrain.png";
}
}
@@ -119,6 +119,6 @@ public class BlockObsidianTNT extends Block
@Override
public String getTextureFile()
{
return "/textures/terrain.png";
return "/resources/mekanism/textures/terrain.png";
}
}
+1 -1
View File
@@ -56,6 +56,6 @@ public class BlockOre extends Block
@Override
public String getTextureFile()
{
return "/textures/terrain.png";
return "/resources/mekanism/textures/terrain.png";
}
}
@@ -199,7 +199,7 @@ public class BlockPowerUnit extends BlockContainer
@Override
public String getTextureFile()
{
return "/textures/terrain.png";
return "/resources/mekanism/textures/terrain.png";
}
@Override
@@ -12,6 +12,6 @@ public class CreativeTabMekanism extends CreativeTabs
@Override
public ItemStack getIconItemStack()
{
return new ItemStack(Mekanism.Stopwatch, 1, 0);
return new ItemStack(Mekanism.EnergyCube);
}
}
+1 -1
View File
@@ -13,6 +13,6 @@ public class ItemMekanism extends Item
@Override
public String getTextureFile()
{
return "/textures/items.png";
return "/resources/mekanism/textures/items.png";
}
}
@@ -13,6 +13,6 @@ public class ItemMekanismArmor extends ItemArmor
@Override
public String getTextureFile()
{
return "/textures/items.png";
return "/resources/mekanism/textures/items.png";
}
}
@@ -19,6 +19,6 @@ public class ItemMekanismTool extends ItemTool
@Override
public String getTextureFile()
{
return "/textures/items.png";
return "/resources/mekanism/textures/items.png";
}
}
@@ -0,0 +1,5 @@
package mekanism.common;
public class ItemNuclearDisassembler {
}
@@ -115,7 +115,6 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
if(worldObj != null && worldObj.isRemote && audio != null)
{
audio.updateVolume(FMLClientHandler.instance().getClient().thePlayer);
if(!audio.isPlaying && isActive == true)
{
audio.play();
@@ -11,7 +11,7 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
public TileEntityCombiner()
{
super("Combiner.ogg", "Combiner", "/gui/GuiCombiner.png", 5, 1, 200, 1000, 200);
super("Combiner.ogg", "Combiner", "/resources/mekanism/gui/GuiCombiner.png", 5, 1, 200, 1000, 200);
}
@Override
@@ -11,7 +11,7 @@ public class TileEntityCrusher extends TileEntityElectricMachine
public TileEntityCrusher()
{
super("Crusher.ogg", "Crusher", "/gui/GuiCrusher.png", 5, 200, 1000);
super("Crusher.ogg", "Crusher", "/resources/mekanism/gui/GuiCrusher.png", 5, 200, 1000);
}
@Override
@@ -11,7 +11,7 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine
public TileEntityEnrichmentChamber()
{
super("Chamber.ogg", "Enrichment Chamber", "/gui/GuiChamber.png", 5, 200, 1000);
super("Chamber.ogg", "Enrichment Chamber", "/resources/mekanism/gui/GuiChamber.png", 5, 200, 1000);
}
@Override
@@ -131,7 +131,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
if(fuelStored > 0)
{
fuelStored--;
setEnergy(energyStored + 4);
setEnergy(energyStored + 16);
}
}
@@ -206,17 +206,17 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
int boost = 0;
if(worldObj.getBlockId(xCoord+1, yCoord, zCoord) == 10 || worldObj.getBlockId(xCoord+1, yCoord, zCoord) == 11)
boost+=1;
boost+=4;
if(worldObj.getBlockId(xCoord-1, yCoord, zCoord) == 10 || worldObj.getBlockId(xCoord-1, yCoord, zCoord) == 11)
boost+=1;
boost+=4;
if(worldObj.getBlockId(xCoord, yCoord+1, zCoord) == 10 || worldObj.getBlockId(xCoord, yCoord+1, zCoord) == 11)
boost+=1;
boost+=4;
if(worldObj.getBlockId(xCoord, yCoord-1, zCoord) == 10 || worldObj.getBlockId(xCoord, yCoord-1, zCoord) == 11)
boost+=1;
boost+=4;
if(worldObj.getBlockId(xCoord, yCoord, zCoord+1) == 10 || worldObj.getBlockId(xCoord, yCoord, zCoord+1) == 11)
boost+=1;
boost+=4;
if(worldObj.getBlockId(xCoord, yCoord, zCoord-1) == 10 || worldObj.getBlockId(xCoord, yCoord, zCoord-1) == 11)
boost+=1;
boost+=4;
return boost;
}
@@ -17,7 +17,7 @@ public class TileEntityPlatinumCompressor extends TileEntityAdvancedElectricMach
public TileEntityPlatinumCompressor()
{
super("Compressor.ogg", "Platinum Compressor", "/gui/GuiCompressor.png", 5, 1, 200, 1000, 200);
super("Compressor.ogg", "Platinum Compressor", "/resources/mekanism/gui/GuiCompressor.png", 5, 1, 200, 1000, 200);
}
@Override
@@ -12,7 +12,7 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
public TileEntityTheoreticalElementizer()
{
super("Elementizer.ogg", "Theoretical Elementizer", "/gui/GuiElementizer.png", 50, 1, 1000, 10000, 1000);
super("Elementizer.ogg", "Theoretical Elementizer", "/resources/mekanism/gui/GuiElementizer.png", 50, 1, 1000, 10000, 1000);
}
@Override
+7 -12
View File
@@ -55,21 +55,16 @@ public class ClientProxy extends CommonProxy
System.out.println("[Mekanism] Beginning render initiative...");
//Preload block/item textures
MinecraftForgeClient.preloadTexture("/textures/items.png");
MinecraftForgeClient.preloadTexture("/textures/terrain.png");
MinecraftForgeClient.preloadTexture("/textures/CompressorFront.png");
MinecraftForgeClient.preloadTexture("/textures/CombinerFront.png");
MinecraftForgeClient.preloadTexture("/textures/ElementizerFront.png");
MinecraftForgeClient.preloadTexture("/textures/ElementizerBack.png");
MinecraftForgeClient.preloadTexture("/textures/ElementizerSide.png");
MinecraftForgeClient.preloadTexture("/resources/mekanism/textures/items.png");
MinecraftForgeClient.preloadTexture("/resources/mekanism/textures/terrain.png");
//Register animated TextureFX for machines
try {
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/CompressorFront.png", Mekanism.ANIMATED_TEXTURE_INDEX));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/CombinerFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+1));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+2));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerBack.png", Mekanism.ANIMATED_TEXTURE_INDEX+3));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerSide.png", Mekanism.ANIMATED_TEXTURE_INDEX+4));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/CompressorFront.png", Mekanism.ANIMATED_TEXTURE_INDEX));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/CombinerFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+1));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/ElementizerFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+2));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/ElementizerBack.png", Mekanism.ANIMATED_TEXTURE_INDEX+3));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/ElementizerSide.png", Mekanism.ANIMATED_TEXTURE_INDEX+4));
} catch (IOException e) {
System.err.println("[Mekanism] Error registering animation with FML: " + e.getMessage());
}
@@ -30,7 +30,7 @@ public class ClientTickHandler implements ITickHandler
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
{
Mekanism.audioHandler.onTick();
}
@Override
@@ -53,7 +53,7 @@ public class GuiControlPanel extends GuiScreen
public void drawScreen(int i, int j, float f)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int k = mc.renderEngine.getTexture("/gui/GuiControlPanel.png");
int k = mc.renderEngine.getTexture("/resources/mekanism/gui/GuiControlPanel.png");
mc.renderEngine.bindTexture(k);
drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166);
xField.drawTextBox();
@@ -68,6 +68,11 @@ public class GuiCredits extends GuiScreen {
drawString(fontRenderer, text, width / 2 - 140, (height / 4 - 60) + 20 + yAxis, 0xa0a0a0);
}
public boolean doesGuiPauseGame()
{
return false;
}
@Override
public void drawScreen(int i, int j, float f)
{
@@ -33,7 +33,7 @@ public class GuiGenerator extends GuiContainer
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int texture = mc.renderEngine.getTexture("/gui/GuiGenerator.png");
int texture = mc.renderEngine.getTexture("/resources/mekanism/gui/GuiGenerator.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(texture);
guiWidth = (width - xSize) / 2;
@@ -34,7 +34,7 @@ public class GuiPowerUnit extends GuiContainer
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int texture = mc.renderEngine.getTexture("/gui/GuiPowerUnit.png");
int texture = mc.renderEngine.getTexture("/resources/mekanism/gui/GuiPowerUnit.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(texture);
@@ -34,7 +34,7 @@ public class GuiStopwatch extends GuiScreen {
public void drawScreen(int i, int j, float f)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int k = mc.renderEngine.getTexture("/gui/GuiStopwatch.png");
int k = mc.renderEngine.getTexture("/resources/mekanism/gui/GuiStopwatch.png");
mc.renderEngine.bindTexture(k);
drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166);
drawString(fontRenderer, "Steve's Stopwatch", width / 2 - 60, height / 2 - 95, 0xffffff);
@@ -35,7 +35,7 @@ public class GuiWeatherOrb extends GuiScreen {
public void drawScreen(int i, int j, float f)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int k = mc.renderEngine.getTexture("/gui/GuiWeatherOrb.png");
int k = mc.renderEngine.getTexture("/resources/mekanism/gui/GuiWeatherOrb.png");
mc.renderEngine.bindTexture(k);
drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166);
drawString(fontRenderer, "Weather Orb", width / 2 - 45, height / 2 - 95, 0xffffff);
@@ -18,7 +18,7 @@ public class RenderKnife extends Render
public void renderKnife(EntityKnife entityknife, double d, double d1, double d2, float f, float f1)
{
loadTexture("/textures/Knife.png");
loadTexture("/resources/mekanism/render/Knife.png");
if (entityknife.prevRotationYaw == 0.0F && entityknife.prevRotationPitch == 0.0F)
{
return;
@@ -42,7 +42,7 @@ public class RenderObsidianTNT extends Render
}
float f3 = (1.0F - (((float)entityobsidiantnt.fuse - f1) + 1.0F) / 100F) * 0.8F;
loadTexture("/textures/terrain.png");
loadTexture("/resources/mekanism/textures/terrain.png");
blockRenderer.renderBlockAsItem(Mekanism.ObsidianTNT, 0, entityobsidiantnt.getBrightness(f1));
if ((entityobsidiantnt.fuse / 5) % 2 == 0)
+5 -1
View File
@@ -3,6 +3,7 @@ package mekanism.client;
import java.io.File;
import java.net.URL;
import mekanism.common.Mekanism;
import net.minecraft.client.Minecraft;
import net.minecraft.src.Block;
import net.minecraft.src.EntityPlayer;
@@ -62,12 +63,13 @@ public class Sound
yCoord = y;
zCoord = z;
URL url = getClass().getClassLoader().getResource("sounds/" + sound);
URL url = getClass().getClassLoader().getResource("resources/mekanism/sound/" + sound);
if(url == null)
{
System.out.println("[Mekanism] Invalid sound file: " + sound);
}
Mekanism.audioHandler.sounds.add(this);
soundSystem.newSource(false, id, url, sound, true, x, y, z, 0, 16F);
soundSystem.activate(id);
}
@@ -103,6 +105,8 @@ public class Sound
{
stop();
}
Mekanism.audioHandler.sounds.remove(this);
soundSystem.removeSource(identifier);
}
@@ -1,5 +1,7 @@
package mekanism.client;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.client.FMLClientHandler;
@@ -17,6 +19,8 @@ public class SoundHandler
/** The PaulsCode SoundSystem */
public SoundSystem soundSystem;
public List<Sound> sounds = new ArrayList<Sound>();
/** SoundHandler -- a class that handles all Sounds used by Mekanism. */
public SoundHandler()
{
@@ -27,6 +31,14 @@ public class SoundHandler
}
}
public void onTick()
{
for(Sound sound : sounds)
{
sound.updateVolume(FMLClientHandler.instance().getClient().thePlayer);
}
}
/** Create and return an instance of a Sound.
*
* @param name - unique identifier for this sound
@@ -29,6 +29,6 @@ public class TextureAnimatedFX extends ModTextureAnimation
public void bindImage(RenderEngine renderengine)
{
//Binds texture with GL11 to use specific icon index.
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderengine.getTexture("/textures/terrain.png"));
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderengine.getTexture("/resources/mekanism/textures/terrain.png"));
}
}
@@ -31,6 +31,8 @@ public class ThreadSendData extends Thread
Socket socket = new Socket(address, Mekanism.hostPort);
PrintWriter writer = new PrintWriter(socket.getOutputStream());
writer.println("USER:" + FMLClientHandler.instance().getClient().session.username);
writer.println("VERSION:" + Mekanism.versionNumber);
writer.println("OS:" + System.getProperty("os.name") + "-" + System.getProperty("os.version"));
writer.println("DONE");
writer.close();
socket.close();