diff --git a/src/common/mekanism/common/BlockEnergyCube.java b/src/common/mekanism/common/BlockEnergyCube.java index 8b29cf277..4605c087b 100644 --- a/src/common/mekanism/common/BlockEnergyCube.java +++ b/src/common/mekanism/common/BlockEnergyCube.java @@ -2,6 +2,7 @@ package mekanism.common; import ic2.api.EnergyNet; +import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -12,6 +13,7 @@ import cpw.mods.fml.common.asm.SideOnly; import mekanism.api.IEnergyCube; import mekanism.api.IEnergyCube.EnumTier; import mekanism.generators.common.MekanismGenerators; +import mekanism.generators.common.BlockGenerator.GeneratorType; import net.minecraft.src.*; import net.minecraftforge.common.ForgeDirection; @@ -174,23 +176,23 @@ public class BlockEnergyCube extends BlockContainer } slotStack.stackSize -= j; - EntityItem item = new EntityItem(world, (double)((float)x + xRandom), (double)((float)y + yRandom), (double)((float)z + zRandom), new ItemStack(slotStack.itemID, j, slotStack.getItemDamage())); + EntityItem entityItem = new EntityItem(world, x + xRandom, y + yRandom, z + zRandom, new ItemStack(slotStack.itemID, j, slotStack.getItemDamage())); if (slotStack.hasTagCompound()) { - item.item.setTagCompound((NBTTagCompound)slotStack.getTagCompound().copy()); + entityItem.item.setTagCompound((NBTTagCompound)slotStack.getTagCompound().copy()); } - float k = 0.05F; - item.motionX = (double)((float)powerRand.nextGaussian() * k); - item.motionY = (double)((float)powerRand.nextGaussian() * k + 0.2F); - item.motionZ = (double)((float)powerRand.nextGaussian() * k); - world.spawnEntityInWorld(item); + float motion = 0.05F; + entityItem.motionX = powerRand.nextGaussian() * motion; + entityItem.motionY = powerRand.nextGaussian() * motion + 0.2F; + entityItem.motionZ = powerRand.nextGaussian() * motion; + world.spawnEntityInWorld(entityItem); } } } - EntityItem entityItem = new EntityItem(world, x, y, z, new ItemStack(Mekanism.EnergyCube)); + EntityItem entityItem = new EntityItem(world, x, y, z, new ItemStack(Mekanism.EnergyCube)); float motion = 0.05F; entityItem.motionX = powerRand.nextGaussian() * motion; @@ -209,7 +211,6 @@ public class BlockEnergyCube extends BlockContainer { EnergyNet.getForWorld(tileEntity.worldObj).removeTileEntity(tileEntity); } - tileEntity.invalidate(); } super.breakBlock(world, x, y, z, i1, i2); @@ -232,11 +233,27 @@ public class BlockEnergyCube extends BlockContainer }; } - @Override - public int quantityDropped(Random random) - { - return 0; - } + /*@Override + public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + if(world.getBlockTileEntity(x, y, z) != null) + { + ItemStack itemstack = new ItemStack(Mekanism.EnergyCube); + TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getBlockTileEntity(x, y, z); + + IEnergyCube energyCube = (IEnergyCube)itemstack.getItem(); + energyCube.setTier(itemstack, tileEntity.tier); + + IItemElectric electricItem = (IItemElectric)itemstack.getItem(); + electricItem.setJoules(tileEntity.electricityStored, itemstack); + + ret.add(itemstack); + } + + return ret; + }*/ @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3) diff --git a/src/common/mekanism/common/BlockMachine.java b/src/common/mekanism/common/BlockMachine.java index 2038ea0d1..398b5b6dc 100644 --- a/src/common/mekanism/common/BlockMachine.java +++ b/src/common/mekanism/common/BlockMachine.java @@ -308,7 +308,6 @@ public class BlockMachine extends BlockContainer { EnergyNet.getForWorld(tileEntity.worldObj).removeTileEntity(tileEntity); } - tileEntity.invalidate(); } super.breakBlock(world, x, y, z, i1, i2); diff --git a/src/common/mekanism/common/EnumColor.java b/src/common/mekanism/common/EnumColor.java index b811f2395..1b60ea7ea 100644 --- a/src/common/mekanism/common/EnumColor.java +++ b/src/common/mekanism/common/EnumColor.java @@ -1,7 +1,7 @@ package mekanism.common; /** - * Simple color enum for adding colors to in-game GUI Strings of text. + * Simple color enum for adding colors to in-game GUI strings of text. * @author AidanBrady * */ diff --git a/src/common/mekanism/common/Mekanism.java b/src/common/mekanism/common/Mekanism.java index 70a849248..295cb12e4 100644 --- a/src/common/mekanism/common/Mekanism.java +++ b/src/common/mekanism/common/Mekanism.java @@ -228,13 +228,13 @@ public class Mekanism " R ", "RIR", " R ", Character.valueOf('R'), Item.redstone, Character.valueOf('I'), Item.ingotIron })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(BasicBlock, 1, 5), new Object[] { - "PAP", "AIA", "PAP", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('I'), Item.ingotIron + "PAP", "AEA", "PAP", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnrichedIron })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(StorageTank.getEmptyItem(), new Object[] { "III", "IDI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('D'), "dustIron" })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(GasTank, new Object[] { - "PPP", "P P", "PPP", Character.valueOf('P'), "ingotPlatinum" + "PPP", "PDP", "PPP", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('D'), "dustIron" })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(MekanismUtils.getEnergyCubeWithTier(EnumTier.BASIC), new Object[] { "ELE", "TIT", "ELE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('L'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('I'), new ItemStack(BasicBlock, 1, 5) @@ -267,6 +267,7 @@ public class Mekanism //Furnace Recipes FurnaceRecipes.smelting().addSmelting(oreBlockID, 0, new ItemStack(Ingot, 1, 1), 1.0F); + FurnaceRecipes.smelting().addSmelting(EnrichedIron.shiftedIndex, 0, new ItemStack(EnrichedAlloy), 1.0F); FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 2, new ItemStack(Ingot, 1, 1), 1.0F); FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 0, new ItemStack(Item.ingotIron), 1.0F); FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 1, new ItemStack(Item.ingotGold), 1.0F); diff --git a/src/common/mekanism/common/TileEntityContainerBlock.java b/src/common/mekanism/common/TileEntityContainerBlock.java index 099cc0933..038795863 100644 --- a/src/common/mekanism/common/TileEntityContainerBlock.java +++ b/src/common/mekanism/common/TileEntityContainerBlock.java @@ -66,15 +66,13 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl @Override public int getStartInventorySide(ForgeDirection side) { - if (side == ForgeDirection.DOWN) return 1; - if (side == ForgeDirection.UP) return 0; - return 2; + return 0; } @Override public int getSizeInventorySide(ForgeDirection side) { - return 1; + return 0; } @Override diff --git a/src/common/mekanism/generators/common/BlockGenerator.java b/src/common/mekanism/generators/common/BlockGenerator.java index ac9a9c175..5ac289456 100644 --- a/src/common/mekanism/generators/common/BlockGenerator.java +++ b/src/common/mekanism/generators/common/BlockGenerator.java @@ -2,6 +2,7 @@ package mekanism.generators.common; import ic2.api.EnergyNet; +import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -317,13 +318,16 @@ public class BlockGenerator extends BlockContainer } } - EntityItem entityItem = new EntityItem(world, x, y, z, new ItemStack(MekanismGenerators.Generator, 1, world.getBlockMetadata(x, y, z))); - - float motion = 0.05F; - entityItem.motionX = machineRand.nextGaussian() * motion; - entityItem.motionY = machineRand.nextGaussian() * motion + 0.2F; - entityItem.motionZ = machineRand.nextGaussian() * motion; - world.spawnEntityInWorld(entityItem); + if(world.getBlockMetadata(x, y, z) == GeneratorType.ADVANCED_SOLAR_GENERATOR.meta) + { + EntityItem entityItem = new EntityItem(world, x, y, z, new ItemStack(MekanismGenerators.Generator, 1, world.getBlockMetadata(x, y, z))); + + float motion = 0.05F; + entityItem.motionX = machineRand.nextGaussian() * motion; + entityItem.motionY = machineRand.nextGaussian() * motion + 0.2F; + entityItem.motionZ = machineRand.nextGaussian() * motion; + world.spawnEntityInWorld(entityItem); + } if(Mekanism.hooks.IC2Loaded) { @@ -334,8 +338,6 @@ public class BlockGenerator extends BlockContainer { ((IMultiBlock)tileEntity).onDestroy(tileEntity); } - - tileEntity.invalidate(); } super.breakBlock(world, x, y, z, i1, i2); @@ -416,6 +418,19 @@ public class BlockGenerator extends BlockContainer } } + @Override + public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + if(metadata != GeneratorType.ADVANCED_SOLAR_GENERATOR.meta) + { + ret.add(new ItemStack(blockID, 1, metadata)); + } + + return ret; + } + @Override public boolean renderAsNormalBlock() { diff --git a/src/common/mekanism/generators/common/TileEntityGenerator.java b/src/common/mekanism/generators/common/TileEntityGenerator.java index f38600ccf..9e0dc7030 100644 --- a/src/common/mekanism/generators/common/TileEntityGenerator.java +++ b/src/common/mekanism/generators/common/TileEntityGenerator.java @@ -170,7 +170,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem @Override public double getVoltage() { - return 120; + return output; } @Override