public override bool BlockActivated(net.minecraft.src.World world, int i, int j, int k, net.minecraft.src.EntityPlayer entityplayer) { if (world.singleplayerWorld) { return(true); } int l = world.GetBlockMetadata(i, j, k); if (!Func_22020_d(l)) { int i1 = Func_22019_c(l); i += field_22023_a[i1][0]; k += field_22023_a[i1][1]; if (world.GetBlockId(i, j, k) != ID) { return(true); } l = world.GetBlockMetadata(i, j, k); } if (!world.worldProvider.Func_28108_d()) { double d = (double)i + 0.5D; double d1 = (double)j + 0.5D; double d2 = (double)k + 0.5D; world.SetBlockWithNotify(i, j, k, 0); int j1 = Func_22019_c(l); i += field_22023_a[j1][0]; k += field_22023_a[j1][1]; if (world.GetBlockId(i, j, k) == ID) { world.SetBlockWithNotify(i, j, k, 0); d = (d + (double)i + 0.5D) / 2D; d1 = (d1 + (double)j + 0.5D) / 2D; d2 = (d2 + (double)k + 0.5D) / 2D; } world.NewExplosion(null, (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, 5F, true ); return(true); } if (Func_22018_f(l)) { net.minecraft.src.EntityPlayer entityplayer1 = null; System.Collections.IEnumerator iterator = world.playerEntities.GetEnumerator(); do { if (!iterator.MoveNext()) { break; } net.minecraft.src.EntityPlayer entityplayer2 = (net.minecraft.src.EntityPlayer)iterator .Current; if (entityplayer2.IsSleeping()) { net.minecraft.src.ChunkCoordinates chunkcoordinates = entityplayer2.playerLocation; if (chunkcoordinates.posX == i && chunkcoordinates.posY == j && chunkcoordinates. posZ == k) { entityplayer1 = entityplayer2; } } }while (true); if (entityplayer1 == null) { Func_22022_a(world, i, j, k, false); } else { entityplayer.Func_22061_a("tile.bed.occupied"); return(true); } } net.minecraft.src.EnumStatus enumstatus = entityplayer.GoToSleep(i, j, k); if (enumstatus == net.minecraft.src.EnumStatus.OK) { Func_22022_a(world, i, j, k, true); return(true); } if (enumstatus == net.minecraft.src.EnumStatus.NOT_POSSIBLE_NOW) { entityplayer.Func_22061_a("tile.bed.noSleep"); } return(true); }