v5 Release

*Fixed generator output.
*Quick fix for BuildCraft transportation pipes.
*Updated crafting recipes.
*Fixed redundant TE invalidation.
This commit is contained in:
Aidan Brady 2012-12-14 11:58:06 -05:00
parent ee7bf323f3
commit 88bed492ee
7 changed files with 62 additions and 32 deletions

View file

@ -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<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
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)

View file

@ -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);

View file

@ -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
*
*/

View file

@ -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);

View file

@ -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

View file

@ -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<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if(metadata != GeneratorType.ADVANCED_SOLAR_GENERATOR.meta)
{
ret.add(new ItemStack(blockID, 1, metadata));
}
return ret;
}
@Override
public boolean renderAsNormalBlock()
{

View file

@ -170,7 +170,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
@Override
public double getVoltage()
{
return 120;
return output;
}
@Override