v5 Release
*Fixed generator output. *Quick fix for BuildCraft transportation pipes. *Updated crafting recipes. *Fixed redundant TE invalidation.
This commit is contained in:
parent
ee7bf323f3
commit
88bed492ee
7 changed files with 62 additions and 32 deletions
|
@ -2,6 +2,7 @@ package mekanism.common;
|
||||||
|
|
||||||
import ic2.api.EnergyNet;
|
import ic2.api.EnergyNet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
@ -12,6 +13,7 @@ import cpw.mods.fml.common.asm.SideOnly;
|
||||||
import mekanism.api.IEnergyCube;
|
import mekanism.api.IEnergyCube;
|
||||||
import mekanism.api.IEnergyCube.EnumTier;
|
import mekanism.api.IEnergyCube.EnumTier;
|
||||||
import mekanism.generators.common.MekanismGenerators;
|
import mekanism.generators.common.MekanismGenerators;
|
||||||
|
import mekanism.generators.common.BlockGenerator.GeneratorType;
|
||||||
import net.minecraft.src.*;
|
import net.minecraft.src.*;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
|
||||||
|
@ -174,23 +176,23 @@ public class BlockEnergyCube extends BlockContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
slotStack.stackSize -= j;
|
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())
|
if (slotStack.hasTagCompound())
|
||||||
{
|
{
|
||||||
item.item.setTagCompound((NBTTagCompound)slotStack.getTagCompound().copy());
|
entityItem.item.setTagCompound((NBTTagCompound)slotStack.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
float k = 0.05F;
|
float motion = 0.05F;
|
||||||
item.motionX = (double)((float)powerRand.nextGaussian() * k);
|
entityItem.motionX = powerRand.nextGaussian() * motion;
|
||||||
item.motionY = (double)((float)powerRand.nextGaussian() * k + 0.2F);
|
entityItem.motionY = powerRand.nextGaussian() * motion + 0.2F;
|
||||||
item.motionZ = (double)((float)powerRand.nextGaussian() * k);
|
entityItem.motionZ = powerRand.nextGaussian() * motion;
|
||||||
world.spawnEntityInWorld(item);
|
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;
|
float motion = 0.05F;
|
||||||
entityItem.motionX = powerRand.nextGaussian() * motion;
|
entityItem.motionX = powerRand.nextGaussian() * motion;
|
||||||
|
@ -209,7 +211,6 @@ public class BlockEnergyCube extends BlockContainer
|
||||||
{
|
{
|
||||||
EnergyNet.getForWorld(tileEntity.worldObj).removeTileEntity(tileEntity);
|
EnergyNet.getForWorld(tileEntity.worldObj).removeTileEntity(tileEntity);
|
||||||
}
|
}
|
||||||
tileEntity.invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, i1, i2);
|
super.breakBlock(world, x, y, z, i1, i2);
|
||||||
|
@ -232,11 +233,27 @@ public class BlockEnergyCube extends BlockContainer
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/*@Override
|
||||||
public int quantityDropped(Random random)
|
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
|
||||||
{
|
{
|
||||||
return 0;
|
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
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
|
||||||
|
|
|
@ -308,7 +308,6 @@ public class BlockMachine extends BlockContainer
|
||||||
{
|
{
|
||||||
EnergyNet.getForWorld(tileEntity.worldObj).removeTileEntity(tileEntity);
|
EnergyNet.getForWorld(tileEntity.worldObj).removeTileEntity(tileEntity);
|
||||||
}
|
}
|
||||||
tileEntity.invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, i1, i2);
|
super.breakBlock(world, x, y, z, i1, i2);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package mekanism.common;
|
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
|
* @author AidanBrady
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -228,13 +228,13 @@ public class Mekanism
|
||||||
" R ", "RIR", " R ", Character.valueOf('R'), Item.redstone, Character.valueOf('I'), Item.ingotIron
|
" 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[] {
|
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[] {
|
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(StorageTank.getEmptyItem(), new Object[] {
|
||||||
"III", "IDI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('D'), "dustIron"
|
"III", "IDI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('D'), "dustIron"
|
||||||
}));
|
}));
|
||||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(GasTank, new Object[] {
|
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[] {
|
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)
|
"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
|
//Furnace Recipes
|
||||||
FurnaceRecipes.smelting().addSmelting(oreBlockID, 0, new ItemStack(Ingot, 1, 1), 1.0F);
|
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, 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, 0, new ItemStack(Item.ingotIron), 1.0F);
|
||||||
FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 1, new ItemStack(Item.ingotGold), 1.0F);
|
FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 1, new ItemStack(Item.ingotGold), 1.0F);
|
||||||
|
|
|
@ -66,15 +66,13 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
||||||
@Override
|
@Override
|
||||||
public int getStartInventorySide(ForgeDirection side)
|
public int getStartInventorySide(ForgeDirection side)
|
||||||
{
|
{
|
||||||
if (side == ForgeDirection.DOWN) return 1;
|
return 0;
|
||||||
if (side == ForgeDirection.UP) return 0;
|
|
||||||
return 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventorySide(ForgeDirection side)
|
public int getSizeInventorySide(ForgeDirection side)
|
||||||
{
|
{
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,6 +2,7 @@ package mekanism.generators.common;
|
||||||
|
|
||||||
import ic2.api.EnergyNet;
|
import ic2.api.EnergyNet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
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)));
|
if(world.getBlockMetadata(x, y, z) == GeneratorType.ADVANCED_SOLAR_GENERATOR.meta)
|
||||||
|
{
|
||||||
float motion = 0.05F;
|
EntityItem entityItem = new EntityItem(world, x, y, z, new ItemStack(MekanismGenerators.Generator, 1, world.getBlockMetadata(x, y, z)));
|
||||||
entityItem.motionX = machineRand.nextGaussian() * motion;
|
|
||||||
entityItem.motionY = machineRand.nextGaussian() * motion + 0.2F;
|
float motion = 0.05F;
|
||||||
entityItem.motionZ = machineRand.nextGaussian() * motion;
|
entityItem.motionX = machineRand.nextGaussian() * motion;
|
||||||
world.spawnEntityInWorld(entityItem);
|
entityItem.motionY = machineRand.nextGaussian() * motion + 0.2F;
|
||||||
|
entityItem.motionZ = machineRand.nextGaussian() * motion;
|
||||||
|
world.spawnEntityInWorld(entityItem);
|
||||||
|
}
|
||||||
|
|
||||||
if(Mekanism.hooks.IC2Loaded)
|
if(Mekanism.hooks.IC2Loaded)
|
||||||
{
|
{
|
||||||
|
@ -334,8 +338,6 @@ public class BlockGenerator extends BlockContainer
|
||||||
{
|
{
|
||||||
((IMultiBlock)tileEntity).onDestroy(tileEntity);
|
((IMultiBlock)tileEntity).onDestroy(tileEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
tileEntity.invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, i1, i2);
|
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
|
@Override
|
||||||
public boolean renderAsNormalBlock()
|
public boolean renderAsNormalBlock()
|
||||||
{
|
{
|
||||||
|
|
|
@ -170,7 +170,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
||||||
@Override
|
@Override
|
||||||
public double getVoltage()
|
public double getVoltage()
|
||||||
{
|
{
|
||||||
return 120;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue