2014-02-15 09:21:40 +01:00
|
|
|
/**
|
2017-11-10 19:30:16 +01:00
|
|
|
* Copyright (c) 2011-2017, SpaceToad and the BuildCraft Team
|
2014-02-15 09:21:40 +01:00
|
|
|
* http://www.mod-buildcraft.com
|
2015-09-20 11:20:30 +02:00
|
|
|
* <p/>
|
2014-02-15 09:21:40 +01:00
|
|
|
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
|
|
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
|
|
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
|
|
|
*/
|
2012-07-25 12:45:15 +02:00
|
|
|
package buildcraft.silicon;
|
2012-05-09 22:43:05 +02:00
|
|
|
|
2014-09-10 15:18:23 +02:00
|
|
|
import java.util.List;
|
2015-05-07 19:49:53 +02:00
|
|
|
|
2012-12-17 23:30:54 +01:00
|
|
|
import net.minecraft.block.material.Material;
|
2012-12-17 23:29:42 +01:00
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2014-02-08 14:47:31 +01:00
|
|
|
import net.minecraft.item.Item;
|
2012-12-17 23:29:42 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.world.World;
|
2015-09-20 11:20:30 +02:00
|
|
|
|
2014-09-10 15:18:23 +02:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2015-05-07 19:49:53 +02:00
|
|
|
|
2014-09-10 15:18:23 +02:00
|
|
|
import buildcraft.BuildCraftSilicon;
|
2014-10-15 18:20:12 +02:00
|
|
|
import buildcraft.api.power.ILaserTargetBlock;
|
2015-03-04 22:44:44 +01:00
|
|
|
import buildcraft.core.BCCreativeTab;
|
2015-03-31 23:21:00 +02:00
|
|
|
import buildcraft.core.lib.block.BlockBuildCraft;
|
2012-05-09 22:43:05 +02:00
|
|
|
|
2014-10-15 18:20:12 +02:00
|
|
|
public class BlockLaserTable extends BlockBuildCraft implements ILaserTargetBlock {
|
2015-09-20 11:20:30 +02:00
|
|
|
protected static final int TABLE_MAX = 6;
|
2012-05-09 22:43:05 +02:00
|
|
|
|
2014-02-08 14:47:31 +01:00
|
|
|
public BlockLaserTable() {
|
|
|
|
super(Material.iron);
|
2012-06-04 22:48:18 +02:00
|
|
|
|
2023-01-29 16:58:27 +01:00
|
|
|
setBlockBounds(0, 0, 0, 1, 9F / 16F, 1);
|
2013-09-16 08:18:14 +02:00
|
|
|
setHardness(10F);
|
2015-03-04 22:44:44 +01:00
|
|
|
setCreativeTab(BCCreativeTab.get("main"));
|
2015-03-26 22:40:59 +01:00
|
|
|
setPassCount(2);
|
|
|
|
setAlphaPass(true);
|
2012-05-09 22:43:05 +02:00
|
|
|
}
|
2012-06-04 22:48:18 +02:00
|
|
|
|
2012-05-09 22:43:05 +02:00
|
|
|
@Override
|
|
|
|
public boolean isOpaqueCube() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean renderAsNormalBlock() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-03-16 16:46:18 +01:00
|
|
|
@Override
|
|
|
|
public int getRenderType() {
|
2023-01-29 16:58:27 +01:00
|
|
|
return 0;
|
2015-03-16 16:46:18 +01:00
|
|
|
}
|
|
|
|
|
2012-05-09 22:43:05 +02:00
|
|
|
@Override
|
2012-08-11 21:56:42 +02:00
|
|
|
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
|
2015-03-09 13:59:13 +01:00
|
|
|
if (super.onBlockActivated(world, i, j, k, entityplayer, par6, par7, par8, par9)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-05-09 22:43:05 +02:00
|
|
|
// Drop through if the player is sneaking
|
2014-03-15 23:57:59 +01:00
|
|
|
if (entityplayer.isSneaking()) {
|
2012-05-09 22:43:05 +02:00
|
|
|
return false;
|
2014-03-15 23:57:59 +01:00
|
|
|
}
|
2012-06-04 22:48:18 +02:00
|
|
|
|
2014-02-10 18:06:44 +01:00
|
|
|
if (!world.isRemote) {
|
2012-10-14 03:40:55 +02:00
|
|
|
int meta = world.getBlockMetadata(i, j, k);
|
|
|
|
entityplayer.openGui(BuildCraftSilicon.instance, meta, world, i, j, k);
|
|
|
|
}
|
2012-05-09 22:43:05 +02:00
|
|
|
return true;
|
|
|
|
}
|
2012-08-24 19:25:54 +02:00
|
|
|
|
2012-10-14 03:40:55 +02:00
|
|
|
@Override
|
2013-03-07 06:31:35 +01:00
|
|
|
public TileEntity createTileEntity(World world, int metadata) {
|
2013-12-29 12:05:21 +01:00
|
|
|
switch (metadata) {
|
|
|
|
case 0:
|
|
|
|
return new TileAssemblyTable();
|
|
|
|
case 1:
|
|
|
|
return new TileAdvancedCraftingTable();
|
|
|
|
case 2:
|
|
|
|
return new TileIntegrationTable();
|
2015-09-20 11:20:30 +02:00
|
|
|
case 3:
|
|
|
|
return new TileChargingTable();
|
2015-02-24 14:39:23 +01:00
|
|
|
case 4:
|
|
|
|
return new TileProgrammingTable();
|
2015-04-20 17:06:33 +02:00
|
|
|
case 5:
|
|
|
|
return new TileStampingTable();
|
2013-12-29 12:05:21 +01:00
|
|
|
}
|
|
|
|
return null;
|
2012-10-14 03:40:55 +02:00
|
|
|
}
|
2012-12-17 23:30:54 +01:00
|
|
|
|
2012-05-09 22:43:05 +02:00
|
|
|
@Override
|
2014-02-08 14:47:31 +01:00
|
|
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
2012-10-14 03:40:55 +02:00
|
|
|
return null;
|
2012-05-09 22:43:05 +02:00
|
|
|
}
|
2012-08-24 19:25:54 +02:00
|
|
|
|
2012-10-22 14:27:32 +02:00
|
|
|
@Override
|
|
|
|
public int damageDropped(int par1) {
|
|
|
|
return par1;
|
|
|
|
}
|
|
|
|
|
2013-12-29 12:05:21 +01:00
|
|
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
2012-05-09 22:43:05 +02:00
|
|
|
@Override
|
2012-10-14 03:40:55 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
2014-02-08 14:47:31 +01:00
|
|
|
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
2015-09-20 11:20:30 +02:00
|
|
|
for (int i = 0; i < TABLE_MAX; i++) {
|
|
|
|
par3List.add(new ItemStack(this, 1, i));
|
|
|
|
}
|
2012-05-09 22:43:05 +02:00
|
|
|
}
|
2013-03-12 20:43:39 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2015-03-09 13:59:13 +01:00
|
|
|
public String[] getIconBlockNames() {
|
2015-09-20 11:20:30 +02:00
|
|
|
return new String[]{
|
2015-03-09 13:59:13 +01:00
|
|
|
"BuildCraft|Silicon:assemblyTable",
|
|
|
|
"BuildCraft|Silicon:advancedCraftingTable",
|
|
|
|
"BuildCraft|Silicon:integrationTable",
|
|
|
|
"BuildCraft|Silicon:chargingTable",
|
2015-04-20 17:06:33 +02:00
|
|
|
"BuildCraft|Silicon:programmingTable",
|
|
|
|
"BuildCraft|Silicon:stampingTable"
|
2015-03-09 13:59:13 +01:00
|
|
|
};
|
2013-03-12 20:43:39 +01:00
|
|
|
}
|
2012-05-09 22:43:05 +02:00
|
|
|
}
|