changed base block file

This commit is contained in:
DarkGuardsman 2013-06-27 13:08:05 -04:00
parent 4e9da6a76f
commit c479ce22ac
12 changed files with 50 additions and 36 deletions

View file

@ -72,10 +72,13 @@ public class ClientProxy extends CommonProxy
switch (ID)
{
case GUI_IMPRINTER:
{
return new GuiImprinter(player.inventory, (TileEntityImprinter) tileEntity);
}
case GUI_ENCODER:
if (tileEntity != null && tileEntity instanceof TileEntityEncoder)
return new GuiEncoder(player.inventory, (TileEntityEncoder) tileEntity);
{
return new GuiEncoder(player.inventory, (TileEntityEncoder) tileEntity);
}
}
}
@ -87,16 +90,14 @@ public class ClientProxy extends CommonProxy
{
return GuiScreen.isCtrlKeyDown();
}
/**
* Renders a laser beam from one power to another by a set color for a set time
/** Renders a laser beam from one power to another by a set color for a set time
*
* @param world - world this laser is to be rendered in
* @param position - start vector3
* @param target - end vector3
* @param color - color of the beam
* @param age - life of the beam in 1/20 secs
*/
* @param age - life of the beam in 1/20 secs */
public void renderBeam(World world, Vector3 position, Vector3 target, Color color, int age)
{
if (world.isRemote || FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)

View file

@ -19,9 +19,7 @@ public class BlockArmbot extends BlockALMachine
{
public BlockArmbot(int id)
{
super(id, UniversalElectricity.machine);
this.setUnlocalizedName("armbot");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
super(id, UniversalElectricity.machine,"armbot");
}
@Override

View file

@ -41,6 +41,7 @@ import assemblyline.common.armbot.command.CommandRotateTo;
import assemblyline.common.armbot.command.CommandUse;
import assemblyline.common.machine.TileEntityAssembly;
import assemblyline.common.machine.encoder.ItemDisk;
import buildcraft.api.power.PowerProvider;
import com.google.common.io.ByteArrayDataInput;
@ -991,5 +992,4 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
{
return false;
}
}

View file

@ -2,20 +2,26 @@ package assemblyline.common.block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import universalelectricity.prefab.block.BlockAdvanced;
import assemblyline.common.AssemblyLine;
import assemblyline.common.TabAssemblyLine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.core.api.INetworkPart;
public class BlockALMachine extends BlockAdvanced
{
public Icon machine_icon;
public BlockALMachine(int id, Material material)
public BlockALMachine(int id, Material material, String name)
{
super(id, material);
this.setUnlocalizedName(name);
this.setCreativeTab(TabAssemblyLine.INSTANCE);
}
@SideOnly(Side.CLIENT)
@ -38,5 +44,29 @@ public class BlockALMachine extends BlockAdvanced
{
return this.machine_icon;
}
@Override
public void onBlockAdded(World world, int x, int y, int z)
{
super.onBlockAdded(world, x, y, z);
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity instanceof INetworkPart)
{
((INetworkPart) tileEntity).updateNetworkConnections();
}
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
{
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity instanceof INetworkPart)
{
((INetworkPart) tileEntity).updateNetworkConnections();
}
}
}

View file

@ -32,9 +32,7 @@ public class BlockCrate extends BlockALMachine
public BlockCrate(int id, int texture)
{
super(id, UniversalElectricity.machine);
this.setUnlocalizedName("crate");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
super(id, UniversalElectricity.machine,"crate");
}
@SideOnly(Side.CLIENT)

View file

@ -27,9 +27,7 @@ public class BlockTurntable extends BlockALMachine
public BlockTurntable(int par1)
{
super(par1, Material.piston);
this.setUnlocalizedName("turntable");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
super(par1, Material.piston,"turntable");
}
@Override

View file

@ -27,9 +27,7 @@ public class BlockImprinter extends BlockALMachine
public BlockImprinter(int id, int texture)
{
super(id, Material.wood);
this.setUnlocalizedName("imprinter");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
super(id, Material.wood,"imprinter");
}
@SideOnly(Side.CLIENT)

View file

@ -23,8 +23,7 @@ public abstract class BlockImprintable extends BlockALMachine
{
public BlockImprintable(String name, int id, Material material, CreativeTabs creativeTab)
{
super(id, material);
this.setUnlocalizedName(name);
super(id, material,name);
this.setCreativeTab(creativeTab);
}

View file

@ -30,10 +30,8 @@ public class BlockConveyorBelt extends BlockALMachine
{
public BlockConveyorBelt(int id)
{
super(id, UniversalElectricity.machine);
this.setUnlocalizedName("conveyorBelt");
super(id, UniversalElectricity.machine,"conveyorBelt");
this.setBlockBounds(0, 0, 0, 1, 0.3f, 1);
this.setCreativeTab(TabAssemblyLine.INSTANCE);
}
@Override

View file

@ -16,9 +16,7 @@ public class BlockCraneController extends BlockALMachine
{
public BlockCraneController(int id)
{
super(id, UniversalElectricity.machine);
this.setUnlocalizedName("craneController");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
super(id, UniversalElectricity.machine,"craneController");
}
@Override

View file

@ -16,9 +16,7 @@ public class BlockCraneFrame extends BlockALMachine
{
public BlockCraneFrame(int id)
{
super(id, UniversalElectricity.machine);
this.setUnlocalizedName("craneFrame");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
super(id, UniversalElectricity.machine,"craneFrame");
this.setBlockBounds(0.25f, 0.25f, 0.25f, 0.75f, 0.75f, 0.75f);
}

View file

@ -21,9 +21,7 @@ public class BlockEncoder extends BlockALMachine
Icon encoder_bottom;
public BlockEncoder(int id, int texture)
{
super(id, Material.wood);
this.setUnlocalizedName("encoder");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
super(id, Material.wood,"encoder");
}
@SideOnly(Side.CLIENT)