001 package net.minecraft.src; 002 003 public class ItemRedstone extends Item 004 { 005 public ItemRedstone(int par1) 006 { 007 super(par1); 008 this.setTabToDisplayOn(CreativeTabs.tabRedstone); 009 } 010 011 public boolean tryPlaceIntoWorld(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) 012 { 013 if (par3World.getBlockId(par4, par5, par6) != Block.snow.blockID) 014 { 015 if (par7 == 0) 016 { 017 --par5; 018 } 019 020 if (par7 == 1) 021 { 022 ++par5; 023 } 024 025 if (par7 == 2) 026 { 027 --par6; 028 } 029 030 if (par7 == 3) 031 { 032 ++par6; 033 } 034 035 if (par7 == 4) 036 { 037 --par4; 038 } 039 040 if (par7 == 5) 041 { 042 ++par4; 043 } 044 045 if (!par3World.isAirBlock(par4, par5, par6)) 046 { 047 return false; 048 } 049 } 050 051 if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6)) 052 { 053 return false; 054 } 055 else 056 { 057 if (Block.redstoneWire.canPlaceBlockAt(par3World, par4, par5, par6)) 058 { 059 --par1ItemStack.stackSize; 060 par3World.setBlockWithNotify(par4, par5, par6, Block.redstoneWire.blockID); 061 } 062 063 return true; 064 } 065 } 066 }