More work on things

This commit is contained in:
Aidan C. Brady 2014-01-17 09:17:38 -05:00
parent 95a3084897
commit 61306fd664
6 changed files with 143 additions and 100 deletions

View file

@ -473,6 +473,6 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
@Override
public String getFlow()
{
return MekanismUtils.getPowerDisplay(20*joulesTransmitted);
return MekanismUtils.getEnergyDisplay(20*joulesTransmitted) + " per second";
}
}

View file

@ -134,7 +134,7 @@ public class BlockBasic extends Block
}
else if(blockID == Mekanism.basicBlock2ID)
{
icons[0][0] = register.registerIcon("mekanism:SalinationBlock");
}
}
@ -184,8 +184,10 @@ public class BlockBasic extends Block
}
else if(blockID == Mekanism.basicBlock2ID)
{
return getIcon(side, metadata);
}
return null;
}
@Override
@ -225,7 +227,7 @@ public class BlockBasic extends Block
}
else if(blockID == Mekanism.basicBlock2ID)
{
return icons[meta][0];
}
return null;
@ -260,6 +262,10 @@ public class BlockBasic extends Block
list.add(new ItemStack(i, 1, 14));
list.add(new ItemStack(i, 1, 15));
}
else if(blockID == Mekanism.basicBlock2ID)
{
list.add(new ItemStack(i, 1, 0));
}
}
@Override
@ -291,6 +297,10 @@ public class BlockBasic extends Block
}
}
}
else if(blockID == Mekanism.basicBlock2ID)
{
}
return super.canCreatureSpawn(type, world, x, y, z);
}
@ -300,21 +310,24 @@ public class BlockBasic extends Block
{
int meta = world.getBlockMetadata(x, y, z);
if(!world.isRemote && meta == 6)
{
TileEntityBin bin = (TileEntityBin)world.getBlockTileEntity(x, y, z);
MovingObjectPosition pos = MekanismUtils.rayTrace(world, player);
if(pos != null && pos.sideHit == bin.facing)
{
if(bin.bottomStack != null)
if(blockID == Mekanism.basicBlockID)
{
if(!world.isRemote && meta == 6)
{
TileEntityBin bin = (TileEntityBin)world.getBlockTileEntity(x, y, z);
MovingObjectPosition pos = MekanismUtils.rayTrace(world, player);
if(pos != null && pos.sideHit == bin.facing)
{
if(!player.isSneaking())
if(bin.bottomStack != null)
{
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.removeStack().copy()));
}
else {
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.remove(1).copy()));
if(!player.isSneaking())
{
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.removeStack().copy()));
}
else {
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.remove(1).copy()));
}
}
}
}

View file

@ -20,20 +20,23 @@ import cpw.mods.fml.relauncher.SideOnly;
/**
* Item class for handling multiple metal block IDs.
* 0: Osmium Block
* 1: Bronze Block
* 2: Refined Obsidian
* 3: Charcoal Block
* 4: Refined Glowstone
* 5: Steel Block
* 6: Bin
* 7: Teleporter Frame
* 8: Steel Casing
* 9: Dynamic Tank
* 10: Dynamic Glass
* 11: Dynamic Valve
* 12: Copper Block
* 13: Tin Block
* 0:0: Osmium Block
* 0:1: Bronze Block
* 0:2: Refined Obsidian
* 0:3: Charcoal Block
* 0:4: Refined Glowstone
* 0:5: Steel Block
* 0:6: Bin
* 0:7: Teleporter Frame
* 0:8: Steel Casing
* 0:9: Dynamic Tank
* 0:10: Dynamic Glass
* 0:11: Dynamic Valve
* 0:12: Copper Block
* 0:13: Tin Block
* 0:14: Salination Controller
* 0:15: Salination Valve
* 1:0: Salination Block
* @author AidanBrady
*
*/
@ -51,9 +54,12 @@ public class ItemBlockBasic extends ItemBlock
@Override
public int getItemStackLimit(ItemStack stack)
{
if(stack.getItemDamage() == 6)
if(itemID == Mekanism.basicBlockID)
{
return 1;
if(stack.getItemDamage() == 6)
{
return 1;
}
}
return 64;
@ -75,7 +81,7 @@ public class ItemBlockBasic extends ItemBlock
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
{
if(itemstack.getItemDamage() == 6)
if(itemID == Mekanism.basicBlockID && itemstack.getItemDamage() == 6)
{
InventoryBin inv = new InventoryBin(itemstack);
@ -99,9 +105,12 @@ public class ItemBlockBasic extends ItemBlock
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack)
{
if(stack.getItemDamage() != 6)
if(itemID == Mekanism.basicBlockID)
{
return true;
if(stack.getItemDamage() != 6)
{
return true;
}
}
if(stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount"))
@ -115,9 +124,12 @@ public class ItemBlockBasic extends ItemBlock
@Override
public ItemStack getContainerItemStack(ItemStack stack)
{
if(stack.getItemDamage() != 6 || stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount"))
if(itemID == Mekanism.basicBlockID)
{
return ItemProxy.getDead();
if(stack.getItemDamage() != 6 || stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount"))
{
return ItemProxy.getDead();
}
}
ItemStack ret = stack.copy();
@ -133,17 +145,20 @@ public class ItemBlockBasic extends ItemBlock
if(place)
{
if(stack.getItemDamage() == 6 && stack.stackTagCompound != null)
if(itemID == Mekanism.basicBlockID)
{
TileEntityBin tileEntity = (TileEntityBin)world.getBlockTileEntity(x, y, z);
InventoryBin inv = new InventoryBin(stack);
if(inv.getItemType() != null)
{
tileEntity.setItemType(inv.getItemType());
}
tileEntity.setItemCount(inv.getItemCount());
if(stack.getItemDamage() == 6 && stack.stackTagCompound != null)
{
TileEntityBin tileEntity = (TileEntityBin)world.getBlockTileEntity(x, y, z);
InventoryBin inv = new InventoryBin(stack);
if(inv.getItemType() != null)
{
tileEntity.setItemType(inv.getItemType());
}
tileEntity.setItemCount(inv.getItemCount());
}
}
}
@ -155,59 +170,71 @@ public class ItemBlockBasic extends ItemBlock
{
String name = "";
switch(itemstack.getItemDamage())
if(itemID == Mekanism.basicBlockID)
{
case 0:
name = "OsmiumBlock";
break;
case 1:
name = "BronzeBlock";
break;
case 2:
name = "RefinedObsidian";
break;
case 3:
name = "CharcoalBlock";
break;
case 4:
name = "RefinedGlowstone";
break;
case 5:
name = "SteelBlock";
break;
case 6:
name = "Bin";
break;
case 7:
name = "TeleporterFrame";
break;
case 8:
name = "SteelCasing";
break;
case 9:
name = "DynamicTank";
break;
case 10:
name = "DynamicGlass";
break;
case 11:
name = "DynamicValve";
break;
case 12:
name = "CopperBlock";
break;
case 13:
name = "TinBlock";
break;
case 14:
name = "SalinationController";
break;
case 15:
name = "SalinationValve";
break;
default:
name = "Unknown";
break;
switch(itemstack.getItemDamage())
{
case 0:
name = "OsmiumBlock";
break;
case 1:
name = "BronzeBlock";
break;
case 2:
name = "RefinedObsidian";
break;
case 3:
name = "CharcoalBlock";
break;
case 4:
name = "RefinedGlowstone";
break;
case 5:
name = "SteelBlock";
break;
case 6:
name = "Bin";
break;
case 7:
name = "TeleporterFrame";
break;
case 8:
name = "SteelCasing";
break;
case 9:
name = "DynamicTank";
break;
case 10:
name = "DynamicGlass";
break;
case 11:
name = "DynamicValve";
break;
case 12:
name = "CopperBlock";
break;
case 13:
name = "TinBlock";
break;
case 14:
name = "SalinationController";
break;
case 15:
name = "SalinationValve";
break;
default:
name = "Unknown";
break;
}
}
else if(itemID == Mekanism.basicBlock2ID)
{
switch(itemstack.getItemDamage())
{
case 0:
name = "SalinationBlock";
break;
}
}
return getUnlocalizedName() + "." + name;

View file

@ -56,6 +56,9 @@ tile.BasicBlock.TinBlock.name=Tin Block
tile.BasicBlock.SalinationController.name=Salination Controller
tile.BasicBlock.SalinationValve.name=Salination Valve
//Basic Block 2 (second ID iteration)
tile.BasicBlock2.SalinationBlock.name=Salination Block
//Machine Block
tile.MachineBlock.EnrichmentChamber.name=Enrichment Chamber
tile.MachineBlock.OsmiumCompressor.name=Osmium Compressor

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB