Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package portuar.cubicBeyond.client.blocks.decondenseur;
- import java.util.Random;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.ItemStack;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.world.World;
- import portuar.cubicBeyond.client.items.ItemCatalystBabyChicken;
- import portuar.cubicBeyond.client.items.ItemCatalystBabyCow;
- import portuar.cubicBeyond.client.items.ItemCatalystBabyPig;
- import portuar.cubicBeyond.client.items.ItemCatalystBabySheep;
- import portuar.cubicBeyond.client.items.ItemCatalystBat;
- import portuar.cubicBeyond.client.items.ItemCatalystCaveSpider;
- import portuar.cubicBeyond.client.items.ItemCatalystChicken;
- import portuar.cubicBeyond.client.items.ItemCatalystCow;
- import portuar.cubicBeyond.client.items.ItemCatalystCowMooshroom;
- import portuar.cubicBeyond.client.items.ItemCatalystCreeper;
- import portuar.cubicBeyond.client.items.ItemCatalystEnderman;
- import portuar.cubicBeyond.client.items.ItemCatalystPig;
- import portuar.cubicBeyond.client.items.ItemCatalystShearedSheep;
- import portuar.cubicBeyond.client.items.ItemCatalystSheep;
- import portuar.cubicBeyond.proxy.ClientProxy;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- public class BlockDecondenseur extends Block
- {
- public BlockDecondenseur()
- {
- super(Material.rock);
- }
- public TileEntity createTileEntity(World world, int metadata)
- {
- return new TileEntityDecondenseur();
- }
- public boolean hasTileEntity(int metadata)
- {
- return true;
- }
- public boolean renderAsNormalBlock()
- {
- return false;
- }
- public boolean isOpaqueCube()
- {
- return false;
- }
- @SideOnly(Side.CLIENT)
- public int getRenderType()
- {
- return ClientProxy.renderInventoryTESRId;
- }
- /**
- * Called when a player hits the block. Args: world, x, y, z, player
- */
- public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player)
- {
- ItemStack stack = player.getCurrentEquippedItem();
- TileEntityDecondenseur te = (TileEntityDecondenseur)world.getTileEntity(x, y, z);
- if(!world.isRemote && te.isUse == false && te != null)
- {
- if ((stack != null) && ((stack.getItem() instanceof ItemCatalystPig)))
- {
- te.coolDown = 150;
- te.isUse = true;
- te.itemId = 1;
- --stack.stackSize;
- if(stack.stackSize == 0)
- {
- stack.stackSize = 0;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement