Added Recipes

This commit is contained in:
Henry Mao 2013-02-10 23:21:29 +08:00
parent caeeaf397c
commit afe1260213
3 changed files with 22 additions and 27 deletions

View file

@ -88,29 +88,26 @@ public class RenderCrate extends TileEntitySpecialRenderer
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
/*
switch (tileEntity.getTier()) switch (tileEntity.getTier())
{ {
default: default:
{ {
itemName = "\u00a7a" + itemName; itemName = "\u00a7a" + itemName;
amount = "\u00a7a" + amount;
break; break;
} }
case 1: case 1:
{ {
itemName = "\u00a74" + itemName; itemName = "\u00a74" + itemName;
amount = "\u00a74" + amount;
break; break;
} }
case 2: case 2:
{ {
itemName = "\u00a79" + itemName; itemName = "\u00a79" + itemName;
amount = "\u00a79" + amount;
break; break;
} }
} }*/
this.renderText(itemName, side, 0.02f, x, y - 0.35f, z); this.renderText(itemName, side, 0.02f, x, y - 0.35f, z);

View file

@ -145,6 +145,12 @@ public class AssemblyLine
System.out.println(NAME + " Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " languages."); System.out.println(NAME + " Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " languages.");
// Crane Controller
GameRegistry.addRecipe(new ShapedOreRecipe(blockCraneController, new Object[] { "SFS", "MCM", "SMS", 'F', blockCraneFrame, 'S', "plateSteel", 'C', "advancedCircuit", 'I', "ingotSteel", 'M', "motor" }));
// Crane Frame
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCraneFrame, 5), new Object[] { "I I", "I I", 'I', Item.ingotIron }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCraneFrame, 5), new Object[] { "I I", "I I", 'I', "ingotBronze" }));
// Armbot // Armbot
GameRegistry.addRecipe(new ShapedOreRecipe(blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', "plateSteel", 'C', "advancedCircuit", 'I', "ingotSteel", 'M', "motor" })); GameRegistry.addRecipe(new ShapedOreRecipe(blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', "plateSteel", 'C', "advancedCircuit", 'I', "ingotSteel", 'M', "motor" }));

View file

@ -213,39 +213,31 @@ public class BlockCrate extends BlockMachine
* *
* @param tileEntity * @param tileEntity
* @param player * @param player
* @param maxStack - The maximum stack size to take out. Default should be 64. * @param requestSize - The maximum stack size to take out. Default should be 64.
* @return True on success * @return True on success
*/ */
public boolean ejectItems(TileEntityCrate tileEntity, EntityPlayer player, int maxStack) public boolean ejectItems(TileEntityCrate tileEntity, EntityPlayer player, int requestSize)
{ {
World world = tileEntity.worldObj; World world = tileEntity.worldObj;
ItemStack containingStack = tileEntity.getStackInSlot(0); ItemStack containingStack = tileEntity.getStackInSlot(0);
if (containingStack != null) if (containingStack != null)
{ {
if (containingStack.stackSize > 0) if (containingStack.stackSize > 0 && requestSize > 0)
{ {
while (maxStack > 0) int amountToTake = Math.min(containingStack.stackSize, requestSize);
ItemStack dropStack = containingStack.copy();
dropStack.stackSize = amountToTake;
if (!world.isRemote)
{ {
int amountToTake = Math.min(containingStack.stackSize, Math.min(maxStack, 64)); EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, dropStack);
ItemStack dropStack = containingStack.copy(); entityItem.delayBeforeCanPickup = 0;
dropStack.stackSize = amountToTake; world.spawnEntityInWorld(entityItem);
if (!world.isRemote)
{
EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, dropStack);
float var13 = 0.05F;
entityItem.motionX = ((float) world.rand.nextGaussian() * var13);
entityItem.motionY = ((float) world.rand.nextGaussian() * var13 + 0.2F);
entityItem.motionZ = ((float) world.rand.nextGaussian() * var13);
entityItem.delayBeforeCanPickup = 0;
world.spawnEntityInWorld(entityItem);
}
containingStack.stackSize -= amountToTake;
maxStack -= amountToTake;
} }
containingStack.stackSize -= amountToTake;
} }
if (containingStack.stackSize <= 0) if (containingStack.stackSize <= 0)